backend-security-audit-skill / rules
Cursor rule0 starsChanged 4 months agoMITView on GitHub
Backend security — audit, fix, and verify secrets, PII, auth, authorization/IDOR, injection, payments, and production hardening. Triggers on API/route/controller/middleware/auth/DB/webhook or config work, or when handling a pre-launch security review.
- Reads credentials
We split this backend-security.mdc into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
When auditing or changing backend security for this project, follow the full skill in SKILL.md and the behavior contract in AGENTS.md (same …
- Very specific: line 31
Verify, don't assume: Use tools where available and quote results: gitleaks detect --redact (+ --log-opts="--all"), npm audit, npx semgrep …
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Backend security — audit, fix, and verify secrets, PII, auth, authorization/IDOR, injection, payments, and production hardening. Triggers on API/route/controller/middleware/auth/DB/webhook or config work, or when handling a pre-launch security review. globs: - "src/**" - "app/**" - "pages/api/**" - "server/**" - "api/**" - "functions/**" - "routes/**" - "controllers/**" - "middleware/**" - "middleware.ts" - "lib/**" - "auth/**" - "prisma/**" - "supabase/**" - "*.env*" - ".gitignore" - "next.config.*" alwaysApply: false --- # Backend Security Audit (Cursor Rule) When auditing or changing backend security for this project, follow the full skill in `SKILL.md` and the behavior contract in `AGENTS.md` (same folder). Summary of non-negotiables: - **Find the real, exploitable weakness first** — don't blindly bolt on controls. Every fix traces to a named risk (hardcoded key, route with no ownership check, client-trusted price, raw SQL concat). - **Never print a discovered secret's value.** Report location (`file:line`) + type, redacted. If a secret is exposed or in **git history**, tell the user to **rotate it immediately** — moving it to env does not un-leak it. - **Run the checks in order:** secrets (code + git history) → PII flow → passwords/sessions → auth → authorization/IDOR → input/injection → payments/logic → API/transport/errors → production hardening → attacker's-perspective pass (last). - **Verify, don't assume.** Use tools where available and quote results: `gitleaks detect --redact` (+ `--log-opts="--all"`), `npm audit`, `npx semgrep --config auto .`, plus `typecheck`/`lint`/`test`. Mark unrun checks "unverified until run." - **Label Confirmed vs Potential;** assign severity (Critical/High/Medium/Low). **Never claim the app is "secure."** - **Do NOT:** weaken/remove existing security controls; exfiltrate data or hit production/third-party systems; change auth/payment/data behavior without calling it out; add heavy security libs without a reason. - **Report** with: Summary, Issues (severity + status), Fixes Applied, Files Changed, Verification, Secrets To Rotate, Remaining Risks, Next Steps. Recommend a human review for money/PII-at-scale apps. Use the checklists in `checklists/` and the worked examples in `examples/`.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend-security-auditSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

