drupal-authentication-failures

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

A Drupal code-checking rule for finding weaknesses in how users are identified and logged in, such as weak password rules or unsafe custom authentication.

In plain words
What is it for?
Use it to review Drupal PHP, module, theme, install, and configuration files for password and login-related issues.
Why use it?
It helps catch authentication problems that could let attackers access accounts or bypass login checks.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to review Drupal PHP, module, theme, install, and configuration files for password and login-related issues.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/drupal-authentication-failures/github.svg)](https://agentmods.dev/rules/ivangrynenko/cursorrules/drupal-authentication-failures)
Your own site
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/drupal-authentication-failures"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/drupal-authentication-failures/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-authentication-failures

Your own site · 80×15
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/drupal-authentication-failures"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/drupal-authentication-failures.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,406 This file is loaded in full into every session.
When invoked 1,406 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.01406 $0.01406
Opus 5.5 $0.00562 $0.00562
Sonnet 5.5 $0.00281 $0.00281
Haiku 4.5 $0.00141 $0.00141

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

Security

Grade A, and why

drupal-authentication-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 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/drupal-authentication-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 Identification and Authentication Failures Standards (OWASP A07:2021)

This rule enforces security best practices to prevent identification and authentication failures in Drupal applications, as defined in OWASP Top 10:2021-A07.

Rule Details

  • Name: drupal_authentication_failures

  • Description: Detect and prevent identification and authentication failures in Drupal as defined in OWASP Top 10:2021-A07

Filters

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

Enforcement Checks

  • Conditions:
    • pattern UserPasswordConstraint|PasswordPolicy|user\\.settings\\.yml – Ensure strong password policies are configured to require complexity, length, and prevent common passwords.
      • Pattern 1: Weak or missing password policies
    • pattern (authenticate|login|auth).*function[^}]*return\\s+(TRUE|true|1)\\s*; – Custom authentication functions should implement proper validation and not return TRUE without checks.
      • Pattern 2: Custom authentication without proper validation
    • pattern ==\\s*\\$password|===\\s*\\$password|strcmp\\(|password_verify\\([^,]+,[^,]+\\$plainTextPassword – Avoid direct password comparison. Use Drupal's built-in password verification services.
      • Pattern 3: Improper password comparison
    • pattern (username|user|pass|password|pwd)\\s*=\\s*['\"][^'\"]+['\"] – Hardcoded credentials detected. Store credentials securely outside of code.
      • Pattern 4: Credentials in code
    • pattern drupal_get_token\\(|form_token|\\$form\\[['\"]#token['\"]\\]\\s*=|drupal_valid_token\\( – Ensure proper CSRF protection is implemented for all authenticated actions.
      • Pattern 5: Missing or weak CSRF protection
    • pattern setcookie\\(|session_regenerate_id\\(false\\)|session_regenerate_id\\([^\\)]* – Use Drupal's session management. If custom code is required, ensure secure session handling practices.
      • Pattern 6: Insecure session management
    • pattern user\\.flood\\.yml|flood_control|UserFloodControl|user_failed_login_ – Ensure proper account lockout and flood control mechanisms are configured to prevent brute force attacks.
      • Pattern 7: Missing account lockout protection
    • pattern user_pass_reset|password_reset|reset.*token – Verify password reset functionality uses secure tokens with proper expiration and validation.
      • Pattern 8: Insecure password reset implementation
    • pattern tfa|two_factor|multi_factor|2fa – Consider implementing multi-factor authentication for sensitive operations or user roles.
      • Pattern 9: Lack of multi-factor authentication
    • pattern \\$user->name\\s*=\\s*['\"]admin['\"]|\\$name\\s*=\\s*['\"]admin['\"]|->values\\(['\"](mdc:name|mail)['\"]\\)\\s*->\\s*set\\(['\"][^\\'\"]+['\"]\\) – Avoid creating default administrator accounts or test users in production code.
      • Pattern 10: Default or test accounts

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,406 tokens per session scan A d49487b8c931

Subscribe to this mod's changes

drupal-authentication-failures is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 11mo ago), licensed MIT. It adds 1,406 tokens to every session, about $0.0056 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.