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.
npx agentmods add rules/ivangrynenko/cursorrules/javascript-broken-access-controlgit clone --depth 1 https://github.com/ivangrynenko/cursorrulesWhat 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 | $0.00000 | $0.04163 |
| Opus 5 | $0.00000 | $0.02082 |
| Sonnet 5 | $0.00000 | $0.00833 |
| Haiku 4.5 | $0.00000 | $0.00416 |
Grade A, and why
javascript-broken-access-control 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 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.
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-broken-access-control — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 401 lines — stays where its author put it; the contents beside it link to each section on GitHub.
JavaScript Broken Access Control (OWASP A01:2021)
This rule identifies and prevents broken access control vulnerabilities in JavaScript applications, focusing on both browser and Node.js environments, as defined in OWASP Top 10:2021-A01.
actions:
-
type: enforce conditions:
Pattern 1: Detect Direct Reference to User-Supplied IDs (IDOR vulnerability)
- pattern: "(?:req|request)\.(?:params|query|body)\.(?:id|userId|recordId)[^\n]*?(?:findById|getById|find\(|get\()" message: "Potential Insecure Direct Object Reference (IDOR) vulnerability. User-supplied IDs should be validated against user permissions before database access."
Pattern 2: Detect Missing Authorization Checks in Route Handlers
- pattern: "(?:app|router)\.(?:get|post|put|delete|patch)\(['"][^'"]+['"],\s*(?:async)?\s*\(?(?:req|request),\s*(?:res|response)(?:,[^\)]+)?\)?\s*=>\s*\{[^\}]*?\}\)" negative_pattern: "(?:isAuthenticated|isAuthorized|checkPermission|verifyAccess|auth\.check|authenticate|authorize|userHasAccess|checkAuth|permissions\.|requireAuth|requiresAuth|ensureAuth|\bauth\b|\broles?\b|\bpermission\b|\baccess\b)" message: "Route handler appears to be missing authorization checks. Implement proper access control to verify user permissions before processing requests."
Pattern 3: Detect JWT Token Validation Issues
- pattern: "(?:jwt|jsonwebtoken)\.verify\((?:[^,]+),\s*'"['"]" message: "Hardcoded JWT secret detected. Store JWT secrets securely in environment variables or a configuration manager."
Pattern 4: Detect Client-Side Authorization Checks
- pattern: "if\s*\((?:user|currentUser)\.(?:role|isAdmin|hasPermission|can[A-Z][a-zA-Z]+|is[A-Z][a-zA-Z]+)\)\s*\{[^\}]?(?:fetch|axios|\$\.ajax|http\.get|http\.post)\([^\)]?\)" message: "Authorization logic implemented on client-side. Client-side authorization checks can be bypassed. Always enforce authorization on the server."
Pattern 5: Detect Improper CORS Configuration
- pattern: "(?:app\.use\(cors\(\{[^\}]?origin:\s['"]\['"])|Access-Control-Allow-Origin:\s['"]\*['"]" message: "Wildcard CORS policy detected. This allows any domain to make cross-origin requests. Restrict CORS to specific trusted domains."
Pattern 6: Detect Lack of Role Checks in Admin Functions
- pattern: "(?:function|const)\s+(?:admin|updateUser|deleteUser|createUser|updateRole|manageUsers|setPermission)[^\{]?\{[^\}]?\}" negative_pattern: "(?:role|permission|isAdmin|hasAccess|authorize|authenticate|auth\.check|checkPermission|checkRole|verifyRole|ensureAdmin|adminOnly|adminRequired|requirePermission)" message: "Administrative function appears to be missing role or permission checks. Implement proper authorization checks to restrict access to administrative functions."
Pattern 7: Detect Missing Login Rate Limiting
- pattern: "(?:function|const)\s+(?:login|signin|authenticate|auth)[^\{]?\{[^\}]?(?:compare(?:Sync)?|check(?:Password)?|match(?:Password)?|verify(?:Password)?)[^\}]*?\}" negative_pattern: "(?:rate(?:Limit)?|throttle|limit|delay|cooldown|attempt|counter|maxTries|maxAttempts|lockout|timeout)" message: "Login function appears to be missing rate limiting. Implement rate limiting to prevent brute force attacks."
Pattern 8: Detect Horizontal Privilege Escalation Vulnerability
- pattern: "(?:findById|findOne|findByPk|get)\((?:req|request)\.(?:params|query|body)\.(?:id|userId|accountId)\)" negative_pattern: "(?:!=|!==|===|==)\s*(?:req\.user\.id|req\.userId|currentUser\.id|user\.id|session\.userId)" message: "Potential horizontal privilege escalation vulnerability. Ensure the requested resource belongs to the authenticated user."
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.
- yesterday First seen · 401 lines · 4,163 tokens per session scan A 13b61a2e2d5b
javascript-broken-access-control 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,163 tokens. 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
astro
Astro: islands, content collections, zero-JS patterns.
electron
Electron: IPC, main/renderer, security best practices.
webdriver-management
Selenium WebDriver lifecycle management — driver factory, explicit waits, browser options, and teardown.
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
test-patterns
Selenium pytest test patterns — data-driven tests, fixtures, error handling, and performance checks.
testing-fundamentals
Core Cypress testing principles — selector strategy, smart waiting, and spec organization. Apply when writing or reviewing Cypress E2E tests.