Security review procedure
A focused rubric for security review of a code change. Designed as the
"security" specialist dimension of a multi-perspective PR review, but
applies equally to a standalone audit.
Scope
Review ONLY your assigned diff (or module). Cross-module concerns go to
the architecture specialist; correctness bugs without security impact go
to correctness.
Checklist summary (10 sections)
- Authentication & authorization — endpoint auth checks, session tokens, RBAC, fail-closed, multi-tenant
- Input validation — type/range/length/encoding, parameterization, regex anchoring, structured data parsers
- Data exposure — error messages, logs, response fields, timing/cache leaks
- Crypto & secrets — hardcoded keys, safe defaults, weak primitives,
random vs secrets, password hashing
- Injection — SQL, shell, LDAP, template, HTML/XSS
- File / path handling — path containment, zip-slip, temp files, symlinks
- Supply chain — typosquatting, pinned versions, endpoint validation
- Deserialization & parsers — pickle, yaml.load, eval, exec, XXE
- Race conditions / TOCTOU — atomic file operations, lock scope
- Denial of service — unbounded loops on user input, rate limiting
See threat-model.md for full per-section detail and CWE mapping.
Severity calibration
CRITICAL — exploitable now, no special conditions: auth bypass, RCE, full data exposure
HIGH — data exposure / auth gap requiring specific conditions
MEDIUM — mis-scoped tokens, weak validation, missing rate limit
LOW — defense-in-depth hardening
INFO — notes for future consideration
Rule of thumb: CRITICAL vs HIGH — user action required to exploit? No = CRITICAL, chained = HIGH.
HIGH vs MEDIUM — exploitable at attacker's expected access level? Yes = HIGH, needs escalation = MEDIUM.
Output format
| Severity |
Location |
Description |
Suggested fix |
Confidence |
Runtime-context caveats |
| HIGH |
file.py:112 |
Path not containment-checked |
Canonicalize, enforce containment, and use race-resistant access |
High |
Symlink and TOCTOU handling depends on the later file operation |
Verdict at top: APPROVE | REQUEST CHANGES | REJECT.
Cite file:line. Reference CWE where clear (CWE-22 path traversal, CWE-89 SQLi).
Ground rules
- Don't invent requirements.
- Flag runtime context you need but can't see.
- Be honest about confidence.
- Review against committed HEAD of the PR branch.
1---2name: security-review3description: >4 Threat-model rubric for a focused security review of a code change. Use5 when reviewing auth / input validation / crypto / secrets / supply chain,6 or as the "security" dimension of a multi-perspective PR review. Pull7 this skill before starting so severity calibration and coverage stay8 consistent.9allowed-tools: [Bash, Read, Glob, Grep]10metadata:11 source: https://skillmd.com/skills/ohdearquant/security-review12---1314# Security review procedure1516A focused rubric for security review of a code change. Designed as the17"security" specialist dimension of a multi-perspective PR review, but18applies equally to a standalone audit.1920## Scope2122Review ONLY your assigned diff (or module). Cross-module concerns go to23the architecture specialist; correctness bugs without security impact go24to correctness.2526## Checklist summary (10 sections)27281. **Authentication & authorization** — endpoint auth checks, session tokens, RBAC, fail-closed, multi-tenant292. **Input validation** — type/range/length/encoding, parameterization, regex anchoring, structured data parsers303. **Data exposure** — error messages, logs, response fields, timing/cache leaks314. **Crypto & secrets** — hardcoded keys, safe defaults, weak primitives, `random` vs `secrets`, password hashing325. **Injection** — SQL, shell, LDAP, template, HTML/XSS336. **File / path handling** — path containment, zip-slip, temp files, symlinks347. **Supply chain** — typosquatting, pinned versions, endpoint validation358. **Deserialization & parsers** — pickle, yaml.load, eval, exec, XXE369. **Race conditions / TOCTOU** — atomic file operations, lock scope3710. **Denial of service** — unbounded loops on user input, rate limiting3839See [threat-model.md](threat-model.md) for full per-section detail and CWE mapping.4041## Severity calibration4243- `CRITICAL` — exploitable now, no special conditions: auth bypass, RCE, full data exposure44- `HIGH` — data exposure / auth gap requiring specific conditions45- `MEDIUM` — mis-scoped tokens, weak validation, missing rate limit46- `LOW` — defense-in-depth hardening47- `INFO` — notes for future consideration4849**Rule of thumb**: CRITICAL vs HIGH — user action required to exploit? No = CRITICAL, chained = HIGH.50HIGH vs MEDIUM — exploitable at attacker's expected access level? Yes = HIGH, needs escalation = MEDIUM.5152## Output format5354| Severity | Location | Description | Suggested fix | Confidence | Runtime-context caveats |55|---|---|---|---|---|---|56| HIGH | `file.py:112` | Path not containment-checked | Canonicalize, enforce containment, and use race-resistant access | High | Symlink and TOCTOU handling depends on the later file operation |5758Verdict at top: `APPROVE` | `REQUEST CHANGES` | `REJECT`.59Cite `file:line`. Reference CWE where clear (CWE-22 path traversal, CWE-89 SQLi).6061## Ground rules62631. Don't invent requirements.642. Flag runtime context you need but can't see.653. Be honest about confidence.664. Review against committed HEAD of the PR branch.