drupal-vulnerable-components

Security rules for Drupal that check for old or vulnerable software components. Components include Drupal core, third-party libraries, and external scripts used by a website.

In plain words
What is it for?
Use them when reviewing Drupal version declarations, PHP function usage, JavaScript library references, and externally loaded scripts.
Why use it?
They help identify outdated Drupal versions, deprecated code, vulnerable JavaScript libraries, and external scripts that lack integrity checks.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/abderrahimghazali/cursor-rules/drupal-vulnerable-components
Clone the repo
git clone --depth 1 https://github.com/abderrahimghazali/cursor-rules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,627 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01627
Opus 5 $0.00000 $0.00813
Sonnet 5 $0.00000 $0.00325
Haiku 4.5 $0.00000 $0.00163

Measured 2d ago against content hash a2573fce6e80, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

drupal-vulnerable-components scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/drupal-vulnerable-components.mdc · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Drupal Vulnerable and Outdated Components Standards (OWASP A06:2021)

This rule enforces security best practices to prevent vulnerabilities related to outdated or vulnerable components in Drupal applications, as defined in OWASP Top 10:2021-A06.

actions:

  • type: enforce conditions:

    Pattern 1: Outdated Drupal core version declaration

    • pattern: "core:\s*('|")8\.0-6|core_version_requirement:\s*('|")[^9].+('|")" message: "Potentially outdated Drupal core version detected. Consider upgrading to the latest secure version of Drupal 9 or 10."

    Pattern 2: Usage of deprecated functions

    • pattern: "drupal_set_message\(|format_date\(|drupal_render\(|entity_load\(|variable_get\(|variable_set\(" message: "Deprecated function detected. Use modern replacements to ensure compatibility and security updates."

    Pattern 3: Known vulnerable libraries referenced

    • pattern: "jquery\.min\.js\?v=1\.|jquery-1\.|jquery-2\.|ckeditor/|tinymce/|angular\.js@1\." message: "Potentially vulnerable JavaScript library version detected. Update to the latest secure version."

    Pattern 4: Direct inclusion of external scripts without SRI

    • pattern: "<script\s+src=['"]http|<script\s+src=['"]//|<link\s+[^>]*href=['"]http" message: "External scripts or stylesheets without Subresource Integrity (SRI) checks detected. Add integrity and crossorigin attributes."

    Pattern 5: Use of obsolete or removed modules

    • pattern: "module:\s*('[^']*captcha'|'recaptcha'|'xmlrpc'|'openid'|'php')" message: "Potentially vulnerable or deprecated module detected. Consider using more secure alternatives."

    Pattern 6: Hard-coded versions in composer.json

    • pattern: ""drupal/[^"]+":\s*"(~|\^)?[0-9]\.[0-9]\.[0-9]"" message: "Hard-coded specific version detected in composer.json. Consider using version ranges to receive security updates."

    Pattern 7: Outdated or insecure PHP API usage

    • pattern: "mysql_|split\(|ereg\(|eregi\(|create_function\(|each\(" message: "Deprecated or insecure PHP function detected. Use modern alternatives for better security."

    Pattern 8: Usage of contrib modules without version constraints

    • pattern: "type:\smodule\s\nname:" message: "Ensure your module specifies core_version_requirement to prevent installation on unsupported Drupal versions."

    Pattern 9: Missing security advisories handling in composer.json

    • pattern: "composer\.json" message: "Consider adding drupal/core-security-advisories as a dev dependency to detect known vulnerable packages."

    Pattern 10: Direct usage of vulnerable sanitization functions

    • pattern: "check_plain\(|filter_xss\(|filter_xss_admin\(" message: "Legacy text sanitization function detected. Use Html::escape() or Xss::filter() instead."
  • type: suggest message: | Drupal Component Security Best Practices:

    1. Update Management:

      • Keep Drupal core updated to the latest secure version
      • Subscribe to the Drupal Security Newsletter
      • Implement a regular update schedule (monthly at minimum)
      • Use security advisories checking in your development workflow
      • Implement Composer's security-advisories metadata
    2. Dependency Management:

      • Use Composer for managing all dependencies
      • Specify version constraints that allow security updates
      • Add drupal/core-security-advisories as a dev dependency
      • Regularly run composer update --with-dependencies
      • Use composer outdated to identify outdated packages

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 139 lines · 1,627 tokens per session scan A a2573fce6e80

Subscribe to this mod's changes

drupal-vulnerable-components is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,627 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.