drupal-integrity-failures

A Drupal code rule that checks for software and data integrity risks listed in the OWASP Top 10, a common security-risk guide.

In plain words
What is it for?
Use it when reviewing Drupal PHP, module, theme, YAML, and JSON files for unsafe deserialization, eval-like functions, and user-controlled file loading.
Why use it?
It helps identify unsafe PHP deserialization, dynamic code execution, and file inclusion patterns that can let attackers run code or manipulate data.

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/ivangrynenko/cursorrules/drupal-integrity-failures
Clone the repo
git clone --depth 1 https://github.com/ivangrynenko/cursorrules

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,384 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.01384
Opus 5 $0.00000 $0.00692
Sonnet 5 $0.00000 $0.00277
Haiku 4.5 $0.00000 $0.00138

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

Security

Grade A, and why

drupal-integrity-failures 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/drupal-integrity-failures.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 Software and Data Integrity Failures Standards (OWASP A08:2021)

This rule enforces security best practices to prevent software and data integrity failures in Drupal applications, as defined in OWASP Top 10:2021-A08.

Rule Details

  • Name: drupal_integrity_failures

  • Description: Detect and prevent software and data integrity failures in Drupal as defined in OWASP Top 10:2021-A08

Filters

  • file extension pattern: \\.(php|inc|module|install|theme|yml|json)$
  • file path pattern: .*

Enforcement Checks

  • Conditions:
    • pattern unserialize\\(\\$|unserialize\\([^,]+\\$|php_unserialize\\(\\$ – Insecure PHP deserialization detected. Use safer alternatives like JSON for data interchange or implement proper validation before deserialization.
      • Pattern 1: Insecure deserialization
    • pattern eval\\(|assert\\(|create_function\\( – Potentially dangerous code execution function detected. Avoid dynamic code execution whenever possible.
      • Pattern 2: Unsafe use of eval or similar functions
    • pattern module_load_include\\(\\$|require(_once)?\\s*\\(\\s*\\$|include(_once)?\\s*\\(\\s*\\$ – Dynamic inclusion of files based on user input is dangerous. Use validated, allowlisted paths only.
      • Pattern 3: Insecure plugin/module loading
    • pattern update\\.settings\\.yml|function [a-zA-Z0-9_]+_update_[0-9]+\\(\\) – Ensure update hooks validate the integrity of updates and data transformations to prevent unauthorized modifications.
      • Pattern 4: Missing update verification
    • pattern ConfigImporter|\\$config_importer|config_import|cmci – Validate configuration before import to ensure integrity and detect potentially malicious changes.
      • Pattern 5: Unsafe configuration imports
    • pattern drupal_http_request\\(|\\\\Drupal::httpClient\\(\\)->get\\(|curl_exec\\( – Always validate data from remote sources before processing or storing it. Implement integrity checks for remote content.
      • Pattern 6: Unchecked remote data
    • pattern composer\\.json – Verify you're using secure Composer practices: validate package signatures, pin dependencies, and use composer.lock.
      • Pattern 7: Insecure Composer usage
    • pattern INSERT\\s+INTO|UPDATE\\s+[a-zA-Z0-9_]+\\s+SET|db_update\\(|->update\\(|->insert\\( – Direct database modifications should implement validation to preserve data integrity. Prefer using entity API.
      • Pattern 8: Direct database modifications
    • pattern file_save_data\\(|file_save_upload\\(|file_copy\\(|file_move\\( – Implement file integrity checking for uploaded or manipulated files to prevent malicious content.
      • Pattern 9: Missing file integrity verification
    • pattern \\$entity\\s*=\\s*new\\s+[A-Za-z]+\\(|::create\\(\\$ – Validate all input used to create entity objects to maintain data integrity and prevent creating malicious entities.
      • Pattern 10: Unsafe entity creation

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. 2d ago First seen · 103 lines · 1,384 tokens per session scan A 7b2030e4e808

Subscribe to this mod's changes

drupal-integrity-failures 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,384 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.