Security Audit Skill
You are performing a security audit. Output a structured report — not just prose.
Step 1 — Define the scope
Ask the user (or infer) the scope:
- Diff — current uncommitted changes (default if there are uncommitted changes)
- Branch —
git diff main...HEAD
- Repo — full working tree
- Path — a specific directory or file
Step 2 — Run the audit
Walk through the OWASP Top 10 (2021) categories systematically:
- A01 Broken Access Control — missing authz checks, IDOR, path traversal
- A02 Cryptographic Failures — weak hashing (MD5, SHA1), hardcoded keys, missing TLS
- A03 Injection — SQL, NoSQL, OS command, LDAP, XSS — search for unparameterized string interpolation in queries, untrusted input in
exec/eval
- A04 Insecure Design — race conditions in critical flows (payments, account changes)
- A05 Security Misconfiguration — debug=true in prod, default creds, exposed admin panels, permissive CORS
- A06 Vulnerable Components — outdated deps with known CVEs (cross-reference package.json/requirements.txt/go.mod)
- A07 Identification & Authentication Failures — weak password policy, missing rate-limit on login, JWT with
alg=none, sessions without timeout
- A08 Software & Data Integrity Failures — unsigned updates, insecure deserialization (pickle, YAML.load, Java ObjectInputStream)
- A09 Logging & Monitoring Failures — sensitive data in logs, missing audit trails
- A10 SSRF — unvalidated URL fetches that could hit internal services (169.254.169.254, localhost)
Step 3 — Look for secrets
Search for committed secrets using these patterns:
aws_secret, AKIA[0-9A-Z]{16}, ghp_[A-Za-z0-9]{36}, sk-[A-Za-z0-9]{32,}
password\s*=\s*['"], api[_-]?key\s*=\s*['"]
.env, .pem, .key files that should be gitignored
Step 4 — Output the report
SECURITY AUDIT REPORT
─────────────────────
Scope: <scope>
Files: <N files scanned>
🔴 CRITICAL (N)
- <file:line> — <issue> — <fix>
🟠 HIGH (N)
- <file:line> — <issue> — <fix>
🟡 MEDIUM (N)
- <file:line> — <issue> — <fix>
🟢 LOW (N)
- <file:line> — <issue> — <fix>
✓ PASSED CHECKS
- <category>: clean
When NOT to use
- Repos with no source code (docs-only)
- When the user wants a code review (use
code-review instead)
- When the user wants a license scan (use
license-check)
Failure modes
- ⚠️ A clean report doesn't mean the code is secure — it means these checks passed.
- ⚠️ Always recommend a real third-party scanner (Semgrep, Snyk, Trivy) for production releases.
1---2name: security-audit3description: Run an OWASP-style security audit on the current diff, the working tree, or a specified path. Flags injection, auth flaws, secrets, insecure deserialization, and misconfigurations.4license: MIT5---67# Security Audit Skill89You are performing a **security audit**. Output a structured report — not just prose.1011## Step 1 — Define the scope1213Ask the user (or infer) the scope:14- **Diff** — current uncommitted changes (default if there are uncommitted changes)15- **Branch** — `git diff main...HEAD`16- **Repo** — full working tree17- **Path** — a specific directory or file1819## Step 2 — Run the audit2021Walk through the OWASP Top 10 (2021) categories systematically:22231. **A01 Broken Access Control** — missing authz checks, IDOR, path traversal242. **A02 Cryptographic Failures** — weak hashing (MD5, SHA1), hardcoded keys, missing TLS253. **A03 Injection** — SQL, NoSQL, OS command, LDAP, XSS — search for unparameterized string interpolation in queries, untrusted input in `exec`/`eval`264. **A04 Insecure Design** — race conditions in critical flows (payments, account changes)275. **A05 Security Misconfiguration** — debug=true in prod, default creds, exposed admin panels, permissive CORS286. **A06 Vulnerable Components** — outdated deps with known CVEs (cross-reference package.json/requirements.txt/go.mod)297. **A07 Identification & Authentication Failures** — weak password policy, missing rate-limit on login, JWT with `alg=none`, sessions without timeout308. **A08 Software & Data Integrity Failures** — unsigned updates, insecure deserialization (pickle, YAML.load, Java ObjectInputStream)319. **A09 Logging & Monitoring Failures** — sensitive data in logs, missing audit trails3210. **A10 SSRF** — unvalidated URL fetches that could hit internal services (169.254.169.254, localhost)3334## Step 3 — Look for secrets3536Search for committed secrets using these patterns:37- `aws_secret`, `AKIA[0-9A-Z]{16}`, `ghp_[A-Za-z0-9]{36}`, `sk-[A-Za-z0-9]{32,}`38- `password\s*=\s*['"]`, `api[_-]?key\s*=\s*['"]`39- `.env`, `.pem`, `.key` files that should be gitignored4041## Step 4 — Output the report4243```44SECURITY AUDIT REPORT45─────────────────────46Scope: <scope>47Files: <N files scanned>4849🔴 CRITICAL (N)50 - <file:line> — <issue> — <fix>5152🟠 HIGH (N)53 - <file:line> — <issue> — <fix>5455🟡 MEDIUM (N)56 - <file:line> — <issue> — <fix>5758🟢 LOW (N)59 - <file:line> — <issue> — <fix>6061✓ PASSED CHECKS62 - <category>: clean63```6465## When NOT to use6667- Repos with no source code (docs-only)68- When the user wants a code review (use `code-review` instead)69- When the user wants a license scan (use `license-check`)7071## Failure modes7273- ⚠️ A clean report doesn't mean the code is secure — it means *these checks* passed.74- ⚠️ Always recommend a real third-party scanner (Semgrep, Snyk, Trivy) for production releases.