drupal-insecure-design

drupal-insecure-design is a cursor rule for Cursor from ivangrynenko/cursorrules. It costs 1,495 tokens per session, scanned A, original, MIT.

A Drupal code rule that checks custom modules, themes, and profiles for insecure design choices listed in the OWASP Top 10, a common security-risk guide.

In plain words
What is it for?
Use it when reviewing custom Drupal PHP and configuration code for permission design, hard-coded rules, and input-sanitization practices.
Why use it?
It helps catch overly broad permissions, fixed business rules, and unsafe sanitization patterns that can make a Drupal site easier to misuse or harder to change safely.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when reviewing custom Drupal PHP and configuration code for permission design, hard-coded rules, and input-sanitization practices.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ivangrynenko/cursorrules/drupal-insecure-design
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.

Clone the repo
git clone --depth 1 https://github.com/ivangrynenko/cursorrules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for drupal-insecure-design

README.md
[![agentmods](https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/drupal-insecure-design/github.svg)](https://agentmods.dev/rules/ivangrynenko/cursorrules/drupal-insecure-design)
Your own site
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/drupal-insecure-design"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/drupal-insecure-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for drupal-insecure-design

Your own site · 80×15
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/drupal-insecure-design"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/drupal-insecure-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,495 This file is loaded in full into every session.
When invoked 1,495 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01495 $0.01495
Opus 5.5 $0.00598 $0.00598
Sonnet 5.5 $0.00299 $0.00299
Haiku 4.5 $0.00150 $0.00150

Measured 1mo ago against content hash 173c39cf13aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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-insecure-design.mdc · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 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.

Rule Details

  • Name: drupal_insecure_design

  • Description: Detect and prevent insecure design patterns in Drupal as defined in OWASP Top 10:2021-A04

Filters

  • file extension pattern: \\.(php|inc|module|install|theme|info\\.yml)$
  • file path pattern: (modules|themes|profiles)/custom

Enforcement Checks

  • Conditions:
    • pattern \\$permissions\\[['\"][^'\"]+['\"]\\]\\s*=\\s*array\\((?![^)]*(administer|manage|edit|delete)[^)]*(content|configuration|users)).*?\\); – Permissions should follow Drupal naming patterns (verb + object) and be specific. Avoid overly broad permissions.
      • Pattern 1: Insecure permission design
    • pattern if\\s*\\([^\\)]*===?\\s*['\"][a-zA-Z0-9_]+['\"]\\s*\\) – Consider moving business logic rules to configuration to allow for proper adjustment without code changes.
      • Pattern 2: Hard-coded business logic values
    • pattern preg_replace|str_replace|strip_tags – Avoid ad hoc sanitization. Use Drupal's built-in sanitization tools: t(), Xss::filter(), etc.
      • Pattern 3: Ad hoc input sanitization
    • pattern class\\s+[a-zA-Z0-9_]+Controller.+\\{[^}]*->query\\( – Follow separation of concerns. Move database logic to services or repositories, not in controllers.
      • Pattern 4: Database logic in controllers
    • pattern function\\s+[a-zA-Z0-9_]+_entity_access\\([^)]*\\)\\s*\\{[^}]*return\\s+AccessResult::allowed\\(\\); – Avoid unconditional access grants. Implement proper conditional checks based on roles, permissions, or entity ownership.
      • Pattern 5: Weak entity access policy
    • pattern session_start|session_set_cookie_params – Avoid custom session management. Use Drupal's session handling system and services.
      • Pattern 6: Custom session management
    • pattern (?:\\\\Drupal::[a-zA-Z_]+\\(\\).*){3,} – Excessive static service calls indicate poor dependency injection. Use proper service injection.
      • Pattern 7: Excessive global state dependency
    • pattern password_verify\\(|password_hash\\( – Avoid custom authentication. Use Drupal's built-in authentication system and services.
      • Pattern 8: Custom user authentication
    • pattern function\\s+[a-zA-Z0-9_]+_schema\\(\\)[^{]*\\{[^}]*return\\s+\\$schema;(?![^}]*validate_utf8|[^}]*'not null') – Database schemas should enforce data integrity with proper constraints (NOT NULL, length, etc.).
      • Pattern 9: Missing schema definitions
    • pattern \\$config\\[['\"](mdc:?!secure_|security_|private_)[^'\"]+['\"]\\]\\s*=\\s*(?:FALSE|0|'0'|\"0\"); – Security-related configuration should default to secure settings (opt-in for potentially insecure features).
      • Pattern 10: Insecure defaults

Read the full file on GitHub · 103 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. 1mo ago First seen · 103 lines · 1,495 tokens per session scan A 173c39cf13aa

Subscribe to this mod's changes

drupal-insecure-design is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 11mo ago), licensed MIT. It adds 1,495 tokens to every session, about $0.0060 per session on Opus 5.5. 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.