javascript-security-misconfiguration

A set of JavaScript rules that checks for common security configuration mistakes, based on the OWASP Top 10 security list.

In plain words
What is it for?
Use it when reviewing JavaScript or Node.js applications for HTTP headers, CORS, environment variables, and cookie settings.
Why use it?
It helps catch unsafe browser and server settings, such as missing security headers, open cross-origin access, exposed configuration values, and insecure cookies.

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-security-misconfiguration
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,246 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.04246
Opus 5 $0.00000 $0.02123
Sonnet 5 $0.00000 $0.00849
Haiku 4.5 $0.00000 $0.00425

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

Security

Grade A, and why

javascript-security-misconfiguration 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 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

// Allow requests with no origin (like mobile apps, curl, etc.)
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.cursor/rules/javascript-security-misconfiguration.mdc · 468 lines

How it starts

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

JavaScript Security Misconfiguration (OWASP A05:2021)

actions:

  • type: enforce conditions:

    Pattern 1: Missing or Insecure HTTP Security Headers

    • pattern: "app\.use\([^)]?\)\s(?!.*(?:helmet|frameguard|hsts|noSniff|xssFilter|contentSecurityPolicy))" location: "(?:app|server|index)\.(?:js|ts)$" message: "Missing HTTP security headers. Consider using Helmet.js to set secure HTTP headers."

    Pattern 2: Insecure CORS Configuration

    • pattern: "app\.use\(cors\(\{[^}]?origin\s:\s*['"]\['"]\s\}\)\)" message: "Insecure CORS configuration. Avoid using wildcard (*) for CORS origin in production environments."

    Pattern 3: Exposed Environment Variables in Client-Side Code

    • pattern: "process\.env\.[A-Z_]+" location: "(?:src|components|pages)" message: "Exposing environment variables in client-side code. Only use environment variables with NEXT_PUBLIC_, REACT_APP_, or VITE_ prefixes for client-side code."
    • pattern: "(?:cookie|cookies|session)\([^)]?\{[^}]?(?:secure\s*:\sfalse|httpOnly\s:\sfalse|sameSite\s:\s*['"]none['"])" message: "Insecure cookie configuration. Set secure:true, httpOnly:true, and appropriate sameSite value for cookies."

    Pattern 5: Missing Content Security Policy

    • pattern: "app\.use\([^)]?helmet\([^)]?\{[^}]?contentSecurityPolicy\s:\s*false" message: "Content Security Policy (CSP) is disabled. Enable and configure CSP to prevent XSS attacks."

    Pattern 6: Debug Information Exposure

    • pattern: "app\.use\([^)]*?morgan\(['"]dev['"]\)|console\.(?:log|debug|info|warn|error)\(" location: "(?:app|server|index)\.(?:js|ts)$" message: "Debug information might be exposed in production. Ensure logging is properly configured based on the environment."

    Pattern 7: Insecure Server Configuration

    • pattern: "app\.disable\(['"]x-powered-by['"]\)" negative_pattern: true location: "(?:app|server|index)\.(?:js|ts)$" message: "X-Powered-By header is not disabled. Use app.disable('x-powered-by') to hide technology information."

    Pattern 8: Directory Listing Enabled

    • pattern: "express\.static\([^)]?\{[^}]?index\s*:\s*false" message: "Directory listing might be enabled. Set index:true or provide an index file to prevent directory listing."

    Pattern 9: Missing Rate Limiting

    • pattern: "app\.(?:get|post|put|delete|patch)\([^)]*?'"['"]" negative_pattern: "(?:rateLimit|rateLimiter|limiter|throttle)" message: "Missing rate limiting for sensitive endpoints. Implement rate limiting to prevent brute force attacks."

    Pattern 10: Insecure WebSocket Configuration

    • pattern: "new\s+WebSocket\([^)]*?\)|io\.on\(['"]connection['"]" negative_pattern: "(?:wss://|https://)" message: "Potentially insecure WebSocket connection. Use secure WebSocket (wss://) in production."

    Pattern 11: Hardcoded Configuration Values

    • pattern: "(?:apiKey|secret|password|token|credentials)\s*=\s*['"][^'"]+['"]" message: "Hardcoded configuration values. Use environment variables or a secure configuration management system."

    Pattern 12: Insecure SSL/TLS Configuration

    • pattern: "https\.createServer\([^)]?\{[^}]?rejectUnauthorized\s*:\s*false" message: "Insecure SSL/TLS configuration. Never set rejectUnauthorized:false in production."

    Pattern 13: Missing Security Middleware

    • pattern: "express\(\)|require\(['"]express['"]\)" negative_pattern: "(?:helmet|cors|rateLimit|bodyParser\.json\(\{\slimit|express\.json\(\{\slimit)" location: "(?:app|server|index)\.(?:js|ts)$" message: "Missing essential security middleware. Consider using helmet, cors, rate limiting, and request size limiting."

Read the full file on GitHub · 468 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 · 468 lines · 4,246 tokens per session scan A ff51486f5147

Subscribe to this mod's changes

javascript-security-misconfiguration 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 4,246 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.