javascript-security-misconfiguration

A set of checks for JavaScript and TypeScript applications based on the OWASP Top 10, a list of common web-application security risks. It looks for unsafe settings such as missing security headers, open cross-origin access, exposed client variables, and insecure cookies.

In plain words
What is it for?
Use it when reviewing JavaScript, JSX, TypeScript, or TSX files for web-security configuration problems, while skipping generated and dependency folders.
Why use it?
It helps catch configuration choices that can make an otherwise secure application easier to attack. The checks focus attention on likely weaknesses during development.

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/abderrahimghazali/cursor-rules/javascript-security-misconfiguration
Clone the repo
git clone --depth 1 https://github.com/abderrahimghazali/cursor-rules

Made for: Cursor.

Per session 4,246 This file is loaded in full into every session.
When invoked 4,246 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.04246 $0.04246
Opus 5 $0.02123 $0.02123
Sonnet 5 $0.00849 $0.00849
Haiku 4.5 $0.00425 $0.00425

Measured yesterday 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 yesterday.

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

This is a copy

100% identical to javascript-security-misconfiguration — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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


description: Detect and prevent security misconfigurations in JavaScript applications as defined in OWASP Top 10:2021-A05 globs: /.js, **/.jsx, /.ts, **/.tsx, !/node_modules/, !/dist/, !/build/, !/coverage/

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."

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. yesterday 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 abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 4,246 tokens to every session, about $0.0212 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to javascript-security-misconfiguration, differing in 0 lines, and is treated as a copy.