1---2name: security-review3description: Checks a change or a module for common security problems (injection, broken access control, secrets, unsafe dependencies, SSRF, XSS, insecure defaults) and explains each finding with a fix. Use when the user asks for a security review or before merging changes that handle input, authentication or files.4license: MIT5version: 1.1.16use_when:7 - Reviewing a change that touches input handling, auth or secrets8 - Checking a module before a release9avoid_when:10 - Replacing a professional penetration test or compliance audit11allowed-tools: Read, Grep, Glob12---13 14# Security review15 16Focus on problems an attacker can actually reach. Trace untrusted input from where it enters to17where it is used.18 19## 1. Map the attack surface20 21- Entry points in the change: HTTP handlers, CLI arguments, files, environment, message queues,22 webhooks, third-party API responses.23- Sensitive sinks: database queries, shell commands, file paths, HTML output, redirects,24 outgoing HTTP requests, deserialisation, logging.25 26## 2. Checklist27 28| Area | Look for |29| -------------------- | ------------------------------------------------------------------------------------ |30| Injection | String-built SQL, shell commands with user input, template injection |31| Access control | Missing ownership checks (IDOR), admin actions without role checks, trust in client |32| Authentication | Weak session handling, tokens in URLs, missing rate limits on login or reset |33| Secrets | Keys or passwords in code, config, tests or logs; secrets sent to the client |34| Input → output | Unescaped HTML (XSS), user-controlled redirect targets, unsafe `Content-Type` |35| Server-side requests | Fetching user-supplied URLs without an allowlist (SSRF), following redirects blindly |36| Files | Path traversal (`../`), unrestricted uploads, archives extracted without limits |37| Dependencies | New packages: maintained? typosquatting? install scripts? pinned versions? |38| Crypto | Home-made crypto, `Math.random` for tokens, missing constant-time comparison |39| Defaults | Debug mode, permissive CORS, missing security headers, verbose error pages |40 41## 3. Report42 43For each finding give: location, how it can be exploited (a concrete request or input),44impact, and the fix. Rank by severity: **critical**, **high**, **medium**, **low**.45Say clearly when something is a hardening suggestion rather than an exploitable bug.46 47## Ground rules48 49- Only analyse code. Do not run exploits against systems you do not own, and do not send real50 data anywhere.51- Never print secrets you find; point to the file and line and recommend rotating them.
Security review
Focus on problems an attacker can actually reach. Trace untrusted input from where it enters to
where it is used.
1. Map the attack surface
- Entry points in the change: HTTP handlers, CLI arguments, files, environment, message queues,
webhooks, third-party API responses.
- Sensitive sinks: database queries, shell commands, file paths, HTML output, redirects,
outgoing HTTP requests, deserialisation, logging.
2. Checklist
| Area | Look for |
|---|
| Injection | String-built SQL, shell commands with user input, template injection |
| Access control | Missing ownership checks (IDOR), admin actions without role checks, trust in client |
| Authentication | Weak session handling, tokens in URLs, missing rate limits on login or reset |
| Secrets | Keys or passwords in code, config, tests or logs; secrets sent to the client |
| Input → output | Unescaped HTML (XSS), user-controlled redirect targets, unsafe Content-Type |
| Server-side requests | Fetching user-supplied URLs without an allowlist (SSRF), following redirects blindly |
| Files | Path traversal (../), unrestricted uploads, archives extracted without limits |
| Dependencies | New packages: maintained? typosquatting? install scripts? pinned versions? |
| Crypto | Home-made crypto, Math.random for tokens, missing constant-time comparison |
| Defaults | Debug mode, permissive CORS, missing security headers, verbose error pages |
3. Report
For each finding give: location, how it can be exploited (a concrete request or input),
impact, and the fix. Rank by severity: critical, high, medium, low.
Say clearly when something is a hardening suggestion rather than an exploitable bug.
Ground rules
- Only analyse code. Do not run exploits against systems you do not own, and do not send real
data anywhere.
- Never print secrets you find; point to the file and line and recommend rotating them.