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/abderrahimghazali/cursor-rules/drupal-insecure-designgit clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesWhat 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.01620 |
| Opus 5 | $0.00000 | $0.00810 |
| Sonnet 5 | $0.00000 | $0.00324 |
| Haiku 4.5 | $0.00000 | $0.00162 |
Grade A, and why
drupal-insecure-design 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.
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 Insecure Design Security Standards (OWASP A04:2021)
This rule enforces security best practices to prevent insecure design vulnerabilities in Drupal applications, as defined in OWASP Top 10:2021-A04.
actions:
-
type: enforce conditions:
Pattern 1: Insecure permission design
- pattern: "\$permissions\[['"][^'"]+['"]\]\s*=\sarray\((?[^)](content|configuration|users)).?\);" message: "Permissions should follow Drupal naming patterns (verb + object) and be specific. Avoid overly broad permissions."
Pattern 2: Hard-coded business logic values
- pattern: "if\s*\([^\)]===?\s['"][a-zA-Z0-9_]+['"]\s*\)" message: "Consider moving business logic rules to configuration to allow for proper adjustment without code changes."
Pattern 3: Ad hoc input sanitization
- pattern: "preg_replace|str_replace|strip_tags" message: "Avoid ad hoc sanitization. Use Drupal's built-in sanitization tools: t(), Xss::filter(), etc."
Pattern 4: Database logic in controllers
- pattern: "class\s+[a-zA-Z0-9_]+Controller.+\{[^}]*->query\(" message: "Follow separation of concerns. Move database logic to services or repositories, not in controllers."
Pattern 5: Weak entity access policy
- pattern: "function\s+[a-zA-Z0-9_]+_entity_access\([^)]\)\s\{[^}]*return\s+AccessResult::allowed\(\);" message: "Avoid unconditional access grants. Implement proper conditional checks based on roles, permissions, or entity ownership."
Pattern 6: Custom session management
- pattern: "session_start|session_set_cookie_params" message: "Avoid custom session management. Use Drupal's session handling system and services."
Pattern 7: Excessive global state dependency
- pattern: "(?:\\Drupal::[a-zA-Z_]+\(\).*){3,}" message: "Excessive static service calls indicate poor dependency injection. Use proper service injection."
Pattern 8: Custom user authentication
- pattern: "password_verify\(|password_hash\(" message: "Avoid custom authentication. Use Drupal's built-in authentication system and services."
Pattern 9: Missing schema definitions
- pattern: "function\s+[a-zA-Z0-9_]+_schema\(\)[^{]*\{[^}]*return\s+\$schema;(?![^}]validate_utf8|[^}]'not null')" message: "Database schemas should enforce data integrity with proper constraints (NOT NULL, length, etc.)."
Pattern 10: Insecure defaults
- pattern: "\$config\['"[^'"]+['"]\]\s*=\s*(?:FALSE|0|'0'|"0");" message: "Security-related configuration should default to secure settings (opt-in for potentially insecure features)."
-
type: suggest message: | Drupal Secure Design Best Practices:
-
Secure Architecture Principles:
- Follow the principle of least privilege for all user roles and permissions
- Implement defense in depth with multiple security layers
- Use Drupal's entity/field API for structured data instead of custom tables
- Employ service-oriented architecture with proper dependency injection
- Follow Drupal coding standards to leverage community security expertise
-
Permission System Design:
- Design granular permissions following the verb+object pattern
- Avoid creating omnipotent permissions that grant excessive access
- Use context-aware access systems like Entity Access or Node Grants
- Consider record-based and field-based access for better control
- Document permission architecture and security implications
-
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.
- 2d ago First seen · 139 lines · 1,620 tokens per session scan A 937396f557c8
drupal-insecure-design 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,620 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.
Other cursor rules, from other repositories
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
creating-skills
Meta-guide for creating effective Claude Code skills with proper structure, CSO optimization, and real examples.
cursorrules
You are a disciplined senior engineer working with someone who may be a domain expert, not a programmer. Build it correctly and safely, not just fast.
cursorrules
Cursor rule "cursorrules" from BlueBirdBack/godot-cursorrules, covering godot 4.4 game development .cursorrules, core development guidelines, code style, naming conventions and scene organization.
new_feature
You are an expert Product Owner and Technical Lead focused on helping users define and plan new features through collaborative discovery and structured documentation.
new_project
You are an expert Product Owner focused on helping users define new software projects through collaborative vision creation.