javascript-identification-authentication-failures

A set of checks for common login and account-security problems in JavaScript applications, based on the OWASP security risk list.

In plain words
What is it for?
Use it when reviewing JavaScript authentication code for basic security failures. It flags patterns that need safer password, login, credential, or session handling.
Why use it?
It helps identify weak password rules, missing multi-factor authentication, exposed credentials, and unsafe session-token storage before they become security issues.

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/javascript-identification-authentication-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 4,519 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.04519
Opus 5 $0.00000 $0.02259
Sonnet 5 $0.00000 $0.00904
Haiku 4.5 $0.00000 $0.00452

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

Security

Grade A, and why

javascript-identification-authentication-failures scanned grade A with 1 finding 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 3d 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.

Sends data to an external URLlowData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

const response = await fetch('https://www.google.com/recaptcha/api/siteverify', { method: 'POST',

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/javascript-identification-authentication-failures.mdc · 494 lines

How it starts

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

JavaScript Identification and Authentication Failures (OWASP A07:2021)

actions:

  • type: enforce conditions:

    Pattern 1: Weak Password Validation

    • pattern: "(?:password|passwd|pwd)\s*\.\s*(?:length\s*[<>]=?\s*(?:[0-9]|10)\b|match\(\s*['"][^'"]['"]\s\))" message: "Weak password validation detected. Implement strong password policies requiring minimum length, complexity, and avoiding common passwords."

    Pattern 2: Missing MFA Implementation

    • pattern: "(?:login|signin|authenticate|auth)\s*\([^)]\)\s\{[^}]*?\}" negative_pattern: "(?:mfa|2fa|two-factor|multi-factor|otp|totp)" message: "Authentication implementation without multi-factor authentication (MFA). Consider implementing MFA for enhanced security."

    Pattern 3: Hardcoded Credentials

    • pattern: "(?:const|let|var)\s+(?:password|passwd|pwd|secret|key|token|apiKey)\s*=\s*['"][^'"]+['"]" message: "Hardcoded credentials detected. Store sensitive authentication data in secure configuration or environment variables."

    Pattern 4: Insecure Session Management

    • pattern: "(?:localStorage|sessionStorage)\.setItem\('"['"]" message: "Storing authentication tokens in localStorage or sessionStorage. Consider using HttpOnly cookies for sensitive authentication data."

    Pattern 5: Missing CSRF Protection

    • pattern: "(?:post|put|delete|patch)\([^)]*?\)" negative_pattern: "(?:csrf|xsrf|token)" location: "(?:src|components|pages|api)" message: "Potential missing CSRF protection in API requests. Implement CSRF tokens for state-changing operations."

    Pattern 6: Insecure JWT Handling

    • pattern: "jwt\.sign\([^)]?{[^}]?}\s*,\s*[^,)]+\s*(?:\)|,\s*{\s*(?:expiresIn|algorithm)\s*:\s*[^}]?}\s\))" negative_pattern: "(?:expiresIn|exp).*(?:algorithm|alg)" message: "Insecure JWT configuration. Ensure JWTs have proper expiration and use secure algorithms (RS256 preferred over HS256)."

    Pattern 7: Insecure Password Storage

    • pattern: "(?:bcrypt|argon2|pbkdf2|scrypt)\.[^(]\([^)]?(?:rounds|iterations|cost|factor)\s*[:<=>]\s*(?:[0-9]|1[0-2])\b" message: "Weak password hashing parameters. Use sufficient work factors for password hashing algorithms."

    Pattern 8: Missing Account Lockout

    • pattern: "(?:login|signin|authenticate|auth)\s*\([^)]\)\s\{[^}]*?\}" negative_pattern: "(?:lock|attempt|count|limit|throttle|rate)" message: "Authentication implementation without account lockout or rate limiting. Implement account lockout after failed attempts."

    Pattern 9: Insecure Password Recovery

    • pattern: "(?:reset|forgot|recover)(?:Password|Pwd)\s*\([^)]\)\s\{[^}]*?\}" negative_pattern: "(?:expire|timeout|token|verify)" message: "Potentially insecure password recovery mechanism. Implement secure, time-limited recovery tokens."

    Pattern 10: Missing Brute Force Protection

    • pattern: "(?:login|signin|authenticate|auth)\s*\([^)]\)\s\{[^}]?\}" negative_pattern: "(?:captcha|recaptcha|hcaptcha|rate\slimit)" message: "Authentication without CAPTCHA or rate limiting. Implement protection against brute force attacks."

    Pattern 11: Insecure Remember Me Functionality

    • pattern: "(?:rememberMe|keepLoggedIn|staySignedIn)" negative_pattern: "(?:secure|httpOnly|sameSite)" message: "Potentially insecure 'Remember Me' functionality. Implement with secure, HttpOnly cookies and proper expiration."

    Pattern 12: Insecure Logout Implementation

    • pattern: "(?:logout|signout)\s*\([^)]\)\s\{[^}]?\}" negative_pattern: "(?:invalidate|revoke|clear|remove).(?:token|session|cookie)" message: "Potentially incomplete logout implementation. Ensure proper invalidation of sessions and tokens on logout."

Read the full file on GitHub · 494 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. 3d ago First seen · 494 lines · 4,519 tokens per session scan A 5c44655b488b

Subscribe to this mod's changes

javascript-identification-authentication-failures is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,519 tokens. A static security scan graded it A with 1 finding (sends data to an external url). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.