Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/ivangrynenko/cursorrulesnpx agentmods add rules/ivangrynenko/cursorrules/javascript-insecure-designWrote 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.
[](https://agentmods.dev/rules/ivangrynenko/cursorrules/javascript-insecure-design)<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/javascript-insecure-design"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/javascript-insecure-design/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.
<a href="https://agentmods.dev/rules/ivangrynenko/cursorrules/javascript-insecure-design"><img src="https://agentmods.dev/badge/rules/ivangrynenko/cursorrules/javascript-insecure-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04533 | $0.04533 |
| Opus 5.5 | $0.01813 | $0.01813 |
| Sonnet 5.5 | $0.00907 | $0.00907 |
| Haiku 4.5 | $0.00453 | $0.00453 |
Grade A, and why
javascript-insecure-design 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- javascript-insecure-design — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 492 lines — stays where its author put it; the contents beside it link to each section on GitHub.
JavaScript Insecure Design (OWASP A04:2021)
actions:
-
type: enforce conditions:
Pattern 1: Lack of Rate Limiting
- pattern: "app\.(?:get|post|put|delete|patch)\([^)]?\)\s(?!.*(?:rateLimiter|limiter|throttle|rateLimit))" location: "(?:routes|api|controllers)" message: "Potential lack of rate limiting in API endpoint. Consider implementing rate limiting to prevent abuse."
Pattern 2: Insecure Direct Object Reference (IDOR)
- pattern: "(?:findById|getById|findOne)\([^)]?(?:req\.|request\.|params\.|query\.|body\.|user\.|input\.|form\.)[^)]?\)\s*(?!.*(?:authorization|permission|access|canAccess|isAuthorized|checkPermission))" location: "(?:routes|api|controllers)" message: "Potential Insecure Direct Object Reference (IDOR) vulnerability. Implement proper authorization checks before accessing objects by ID."
Pattern 3: Lack of Input Validation
- pattern: "(?:req\.|request\.|params\.|query\.|body\.|user\.|input\.|form\.)[a-zA-Z0-9_]+\s*(?!.*(?:validate|sanitize|check|schema|joi|yup|zod|validator|isValid))" location: "(?:routes|api|controllers)" message: "Potential lack of input validation. Implement proper validation for all user inputs."
Pattern 4: Hardcoded Business Logic
- pattern: "if\s*\([^)]?(?:role\s===\s*['"]admin['"]|isAdmin\s*===\strue|user\.role\s===\s*['"]admin['"])\s*\)" message: "Hardcoded business logic for authorization. Consider using a more flexible role-based access control system."
Pattern 5: Lack of Proper Error Handling
- pattern: "catch\s*\([^)]?\)\s\{[^}]?(?:console\.(?:log|error))[^}]?\}" negative_pattern: "(?:res\.status|next\(err|next\(error|errorHandler)" message: "Improper error handling. Avoid only logging errors without proper handling or user feedback."
Pattern 6: Insecure Authentication Design
- pattern: "(?:password|token|secret|key)\s*===\s*(?:req\.|request\.|params\.|query\.|body\.|user\.|input\.|form\.)" message: "Insecure authentication design. Avoid direct string comparison for passwords or tokens."
Pattern 7: Lack of Proper Logging
- pattern: "app\.(?:get|post|put|delete|patch)\([^)]?\)\s(?!.*(?:log|logger|winston|bunyan|morgan|audit))" location: "(?:routes|api|controllers)" message: "Lack of proper logging in API endpoint. Implement logging for security-relevant events."
Pattern 8: Insecure Defaults
- pattern: "new\s+(?:Session|Cookie|JWT)\([^)]?\{[^}]?(?:secure\s*:\sfalse|httpOnly\s:\sfalse|sameSite\s:\s*['"]none['"])" message: "Insecure default configuration. Avoid setting secure:false, httpOnly:false, or sameSite:'none' for cookies or sessions."
Pattern 9: Lack of Proper Access Control
- pattern: "router\.(?:get|post|put|delete|patch)\([^)]?\)\s(?!.*(?:authenticate|authorize|requireAuth|isAuthenticated|checkAuth|verifyToken|passport\.authenticate))" location: "(?:routes|api|controllers)" message: "Potential lack of access control in route definition. Implement proper authentication and authorization middleware."
Pattern 10: Insecure File Operations
- pattern: "(?:fs\.(?:readFile|writeFile|appendFile|readdir|stat|access|open|unlink)|require)\([^)]?(?:(?:\+|\$\{|\`)[^)]?(?:__dirname|__filename|process\.cwd\(\)|path\.(?:resolve|join)))" negative_pattern: "path\.normalize|path\.resolve|path\.join" message: "Insecure file operations. Use path.normalize() and validate file paths to prevent directory traversal attacks."
Pattern 11: Lack of Proper Secrets Management
- pattern: "(?:apiKey|secret|password|token|credentials)\s*=\s*(?:process\.env\.[A-Z_]+|config\.[a-zA-Z0-9_]+|['"][^'"]+['"])" negative_pattern: "(?:vault|secretsManager|keyVault|secretClient)" message: "Insecure secrets management. Consider using a dedicated secrets management solution instead of environment variables or configuration files."
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.
- 1mo ago First seen · 492 lines · 4,533 tokens per session scan A c9992e65cd40
javascript-insecure-design is a cursor rule published in the GitHub repository ivangrynenko/cursorrules (88 stars, last pushed 11mo ago), licensed MIT. It adds 4,533 tokens to every session, about $0.0181 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.
Other cursor rules, from other repositories
refactoring
Refactoring: systematic approach, extract/inline, guard clauses, early returns.
cross-tool-config
Cross-tool AI config: what transfers between Cursor, Claude Code, Copilot, Windsurf, Gemini, and Codex.
angular
Angular: signals, standalone components, RxJS patterns.
django
Django: models, views, ORM best practices.
fastapi
FastAPI: Pydantic v2, dependency injection, async.
tailwind-css
Tailwind CSS: utility patterns, design tokens, component extraction.