

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Drupal Identification and Authentication Failures Standards (OWASP A07:2021)78This rule enforces security best practices to prevent identification and authentication failures in Drupal applications, as defined in OWASP Top 10:2021-A07.910## Rule Details1112- **Name:** drupal_authentication_failures1314- **Description:** Detect and prevent identification and authentication failures in Drupal as defined in OWASP Top 10:2021-A071516## Filters17- file extension pattern: `\\.(php|inc|module|install|theme|yml)$`18- file path pattern: `.*`1920## Enforcement Checks21- Conditions:22 - pattern `UserPasswordConstraint|PasswordPolicy|user\\.settings\\.yml` – Ensure strong password policies are configured to require complexity, length, and prevent common passwords.23 - Pattern 1: Weak or missing password policies24 - pattern `(authenticate|login|auth).*function[^}]*return\\s+(TRUE|true|1)\\s*;` – Custom authentication functions should implement proper validation and not return TRUE without checks.25 - Pattern 2: Custom authentication without proper validation26 - pattern `==\\s*\\$password|===\\s*\\$password|strcmp\\(|password_verify\\([^,]+,[^,]+\\$plainTextPassword` – Avoid direct password comparison. Use Drupal's built-in password verification services.27 - Pattern 3: Improper password comparison28 - pattern `(username|user|pass|password|pwd)\\s*=\\s*['\"][^'\"]+['\"]` – Hardcoded credentials detected. Store credentials securely outside of code.29 - Pattern 4: Credentials in code30 - pattern `drupal_get_token\\(|form_token|\\$form\\[['\"]#token['\"]\\]\\s*=|drupal_valid_token\\(` – Ensure proper CSRF protection is implemented for all authenticated actions.31 - Pattern 5: Missing or weak CSRF protection32 - pattern `setcookie\\(|session_regenerate_id\\(false\\)|session_regenerate_id\\([^\\)]*` – Use Drupal's session management. If custom code is required, ensure secure session handling practices.33 - Pattern 6: Insecure session management34 - 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.35 - Pattern 7: Missing account lockout protection36 - pattern `user_pass_reset|password_reset|reset.*token` – Verify password reset functionality uses secure tokens with proper expiration and validation.37 - Pattern 8: Insecure password reset implementation38 - pattern `tfa|two_factor|multi_factor|2fa` – Consider implementing multi-factor authentication for sensitive operations or user roles.39 - Pattern 9: Lack of multi-factor authentication40 - 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.41 - Pattern 10: Default or test accounts4243## Suggestions44- Guidance:45**Drupal Authentication Security Best Practices:**46471. **Password Policies:**48 - Use Drupal's Password Policy module for enforcing strong passwords49 - Configure minimum password length (12+ characters recommended)50 - Require complexity (uppercase, lowercase, numbers, special characters)51 - Implement password rotation for sensitive roles52 - Check passwords against known breached password databases53542. **Authentication Infrastructure:**55 - Use Drupal's core authentication mechanisms rather than custom solutions56 - Implement proper account lockout after failed login attempts57 - Consider multi-factor authentication (TFA module) for privileged accounts58 - Implement session timeout for inactivity59 - Use HTTPS for all authentication traffic60613. **Session Management:**62 - Use Drupal's session management system rather than PHP's session functions63 - Configure secure session cookie settings in settings.php64 - Implement proper session regeneration on privilege changes65 - Consider using the Session Limit module to restrict concurrent sessions66 - Properly destroy sessions on logout67684. **Account Management:**69 - Implement proper account provisioning and deprovisioning processes70 - Use email verification for new account registration71 - Implement secure password reset mechanisms with limited-time tokens72 - Apply the principle of least privilege for user roles73 - Regularly audit user accounts and permissions74755. **Authentication Hardening:**76 - Monitor for authentication failures and suspicious patterns77 - Implement IP-based and username-based flood control78 - Log authentication events for security monitoring79 - Consider CAPTCHA or reCAPTCHA for login forms80 - Use OAuth or SAML for single sign-on where appropriate8182## Validation Checks83- Conditions:84 - pattern `password_verify\\(|UserPassword|\\\\Drupal::service\\(['\"]password['\"]\\)` – Using Drupal's password services correctly.85 - Check 1: Proper password handling86 - pattern `\\$form\\[['\"]#token['\"]\\]\\s*=\\s*['\"][^'\"]+['\"]` – Form includes CSRF protection token.87 - Check 2: CSRF token implementation88 - pattern `\\$request->getSession\\(\\)|\\\\Drupal::service\\(['\"]session['\"]\\)` – Using Drupal's session management services.89 - Check 3: Proper session management90 - pattern `user\\.flood\\.yml|flood|user_login_final_validate` – Implementing user flood protection.91 - Check 4: User flood control9293## Metadata94- Priority: high95- Version: 1.196- Tags: security, drupal, authentication, identification, owasp, language:php, framework:drupal, category:security, subcategory:authentication, standard:owasp-top10, risk:a07-authentication-failures97## References98- https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/99- https://www.drupal.org/docs/security-in-drupal/drupal-security-best-practices100- https://www.drupal.org/project/tfa101- https://www.drupal.org/project/password_policy102103
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| ivangrynenko/cursorrules.cursor/rules/behat-steps.mdc · 87 | Cursor rules | lint-formatstyleperformanceagent-behaviour | 42/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/confluence-editing-standards.mdc · 87 | Cursor rules | stylearchsecuritydeployment | 60/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/cursor-rules.mdc · 87 | Cursor rules | teststylearchgit+2 | 77/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/debugging-standards.mdc · 87 | Cursor rules | no sections | 30/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-broken-access-control.mdc · 87 | Cursor rules | stylesecurity | 52/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-cryptographic-failures.mdc · 87 | Cursor rules | security | 48/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-database-standards.mdc · 87 | Cursor rules | database | 30/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-file-permissions.mdc · 87 | Cursor rules | stylearchsecurity | 62/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-injection.mdc · 87 | Cursor rules | securitydo-not | 55/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-insecure-design.mdc · 87 | Cursor rules | security | 48/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-integrity-failures.mdc · 87 | Cursor rules | style | 60/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-logging-failures.mdc · 87 | Cursor rules | security | 48/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-security-misconfiguration.mdc · 87 | Cursor rules | security | 48/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-ssrf.mdc · 87 | Cursor rules | style | 52/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/drupal-vulnerable-components.mdc · 87 | Cursor rules | stylesecurity | 67/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/git-commit-standards.mdc · 87 | Cursor rules | git | 44/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/github-actions-standards.mdc · 87 | Cursor rules | no sections | 44/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/improve-cursorrules-efficiency.mdc · 87 | Cursor rules | no sections | 34/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/javascript-broken-access-control.mdc · 87 | Cursor rules | securitydo-not | 39/100 | 14 days ago | |
| ivangrynenko/cursorrules.cursor/rules/javascript-cryptographic-failures.mdc · 87 | Cursor rules | security | 40/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 46 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 14 days ago | |
| skillrecordings/egghead-next.cursor/rules/gh-task-plan.mdc · 1.4k | Cursor rules | teststylearchtypes+2 | 96/100 | 14 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-user-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 14 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126 | Cursor rules | buildlint-formatstylearch+3 | 96/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/ivangrynenko-cursorrules-cursor-rules-drupal-authentication-failures)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.