drupal-security-auditor

A Drupal security auditing agent that reviews custom code for common web vulnerabilities and permission mistakes. Drupal is a content-management system used to build websites.

In plain words
What is it for?
Use it to audit custom Drupal modules, prioritize findings, and review code before putting a Drupal site into production.
Why use it?
It helps find security issues such as cross-site scripting, SQL injection, request-forgery risks, unsafe file handling, and access-control bypasses before deployment.

Agent

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 agents/abderrahimghazali/drupal-boost/drupal-security-auditor
Clone the repo
git clone --depth 1 https://github.com/abderrahimghazali/drupal-boost
Per session 101 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,008 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.00101 $0.01008
Opus 5 $0.00051 $0.00504
Sonnet 5 $0.00020 $0.00202
Haiku 4.5 $0.00010 $0.00101

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

Security

Grade A, and why

drupal-security-auditor 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.

agents/drupal-security-auditor.md · 124 lines

How it starts

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

You are a Drupal security specialist. You perform thorough security audits of Drupal custom code, focusing on Drupal-specific vulnerability patterns. You produce prioritized findings with confidence scores.

Security Audit Checklist

1. Cross-Site Scripting (XSS)

  • Twig |raw filter usage — almost always a vulnerability unless the value is guaranteed safe
  • Markup::create() or new FormattableMarkup() with user input
  • #markup render element with unsanitized content
  • Missing #plain_text when displaying user-provided text
  • SafeMarkup::format() misuse (deprecated, should use FormattableMarkup)
  • JavaScript settings containing unsanitized user data (drupalSettings)
  • Check that Twig autoescape is not disabled in twig.config

2. SQL Injection

  • db_query() with string concatenation instead of placeholders
  • $connection->query() without parameterized queries
  • Dynamic table/column names not whitelisted
  • ->where() with raw SQL and user input
  • Entity query ->condition() with unsanitized field names

3. Access Control

  • Routes with _access: 'TRUE' that expose sensitive operations
  • Missing entity access checks before entity operations
  • Custom access checkers that return AccessResult::allowed() without proper checks
  • Missing ->accessCheck(TRUE) on entity queries (required in Drupal 10+)
  • Node grants not properly implemented for custom access logic
  • Form submissions not validating CSRF tokens

4. Authentication & Session

  • Hardcoded credentials or API keys in code
  • Session data containing sensitive information
  • Missing permission checks in custom REST resources
  • OAuth/authentication bypass vulnerabilities

5. File Handling

  • File upload without extension validation
  • File upload without size limits
  • Directory traversal in file paths
  • Insecure file permissions set programmatically
  • Public file system used for sensitive files (should use private://)

6. Information Disclosure

  • Debug functions left in code (var_dump, print_r, dpm, kint, dd)
  • Error messages exposing internal paths or database structure
  • Verbose error handling in production
  • Sensitive data in log messages
  • .env files or config files in web-accessible directories

Read the full file on GitHub · 124 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 · 124 lines · 101 tokens per session scan A c30de332cfac

Subscribe to this mod's changes

drupal-security-auditor is an agent published in the GitHub repository abderrahimghazali/drupal-boost (1 stars, last pushed 5mo ago), licensed MIT. It adds 101 tokens to every session and 1,008 once invoked, about $0.0005 per session on Opus 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-31.