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.
npx agentmods add rules/ivangrynenko/cursorrules/drupal-injectiongit clone --depth 1 https://github.com/ivangrynenko/cursorrulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01482 |
| Opus 5 | $0.00000 | $0.00741 |
| Sonnet 5 | $0.00000 | $0.00296 |
| Haiku 4.5 | $0.00000 | $0.00148 |
Grade A, and why
drupal-injection 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 yesterday.
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.
Copies of this mod
1 near-identical copy found in the catalogue:
- drupal-injection — 89% identical, 206 lines differ
How it starts
The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Drupal Injection Security Standards (OWASP A03:2021)
This rule enforces security best practices to prevent injection vulnerabilities in Drupal applications, as defined in OWASP Top 10:2021-A03.
Rule Details
-
Name: drupal_injection
-
Description: Detect and prevent injection vulnerabilities in Drupal as defined in OWASP Top 10:2021-A03
Filters
- file extension pattern:
\\.(php|inc|module|install|theme)$ - file path pattern:
(modules|themes|profiles|core)/.*
Enforcement Checks
- Conditions:
- pattern
db_query\\(['\"][^'\"]*\\$[^'\"]*['\"]– Direct variables in SQL queries are vulnerable to SQL injection. Use parameterized queries with placeholders.- Pattern 1: Raw SQL queries without placeholders
- pattern
->query\\(['\"][^'\"]*\\$[^'\"]*['\"]– Use parameterized queries with placeholders to prevent SQL injection: ->query($sql, [$param1, $param2]).- Pattern 2: Modern DB API without placeholders
- pattern
<?=|<?php\\s+echo\\s+(?!(t|\\\\t|\\$this->t))[^;]*;– Direct output may lead to XSS. Use t(), escaped variables with Html::escape(), or Twig templates.- Pattern 3: Unescaped output
- pattern
[\"']#markup[\"']\\s*=>\\s*(?!t\\(|\\\\t\\(|Xss::filterAdmin|Html::escape)\\$– Never use unfiltered variables in #markup. Use t(), Xss::filterAdmin(), or Html::escape().- Pattern 4: Unfiltered user input in render arrays
- pattern
->addJsSettings\\(\\[(?![^\\]]*(Xss::filter|Json::encode))\\$– Filter variables before adding to JavaScript settings using Xss::filter() or properly encode with Json::encode().- Pattern 5: Unescaped variables in JavaScript settings
- pattern `exec\(|shell_exec\(|system\(|passthru\(|proc_open\(|popen\(|`` – Command execution functions can lead to command injection. Use Symfony\Component\Process\Process if necessary.
- Pattern 6: Direct command execution
- pattern
->redirect\\(\\s*\\$(?!(this->|allowed_destinations|config))– Unvalidated redirects can lead to open redirect vulnerabilities. Whitelist allowed destinations.- Pattern 7: Unvalidated redirect
- pattern
->condition\\([^,]*,\\s*\\$(?!(this->|config|entity|storage))[^,]*,– Use proper input validation before using variables in database conditions to prevent SQL injection.- Pattern 8: Raw user input in conditions
- pattern
(?<!buildForm|getFormId)\\s*function\\s+[a-zA-Z0-9_]+Form\\s*\\([^{]*\\{[^}]*return\\s+\\$form;(?![^}]*FormBuilderInterface|[^}]*::TOKEN|[^}]*#token)– Form submissions must include CSRF protection with $form['#token'].- Pattern 9: Missing CSRF protection in forms
- pattern
file_get_contents\\(\\s*\\$(?!(this->|allowed_paths|config))– Validate file paths before operations to prevent path traversal attacks.- Pattern 10: Unvalidated file operations
- pattern
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.
- yesterday First seen · 97 lines · 1,482 tokens per session scan A 2366d3a9a2a4
drupal-injection is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (87 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,482 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-30.
Other cursor rules, from other repositories
angular
Angular: signals, standalone components, RxJS patterns.
django
Django: models, views, ORM best practices.
java
Modern Java: records, sealed classes, streams, virtual threads.
javascript
Modern JavaScript: ES2023+, async patterns, common traps.
rust
Rust patterns: ownership, Result types, iterators.
accessibility
Accessibility: semantic HTML, ARIA, keyboard navigation, testing.