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.06allowed-tools: Read, Grep, Glob7---8 9# Security review10 11Focus on problems an attacker can actually reach. Trace untrusted input from where it enters to12where it is used.13 14## 1. Map the attack surface15 16- Entry points in the change: HTTP handlers, CLI arguments, files, environment, message queues,17 webhooks, third-party API responses.18- Sensitive sinks: database queries, shell commands, file paths, HTML output, redirects,19 outgoing HTTP requests, deserialisation, logging.20 21## 2. Checklist22 23| Area | Look for |24| -------------------- | ------------------------------------------------------------------------------------ |25| Injection | String-built SQL, shell commands with user input, template injection |26| Access control | Missing ownership checks (IDOR), admin actions without role checks, trust in client |27| Authentication | Weak session handling, tokens in URLs, missing rate limits on login or reset |28| Secrets | Keys or passwords in code, config, tests or logs; secrets sent to the client |29| Input → output | Unescaped HTML (XSS), user-controlled redirect targets, unsafe `Content-Type` |30| Server-side requests | Fetching user-supplied URLs without an allowlist (SSRF), following redirects blindly |31| Files | Path traversal (`../`), unrestricted uploads, archives extracted without limits |32| Dependencies | New packages: maintained? typosquatting? install scripts? pinned versions? |33| Crypto | Home-made crypto, `Math.random` for tokens, missing constant-time comparison |34| Defaults | Debug mode, permissive CORS, missing security headers, verbose error pages |35 36## 3. Report37 38For each finding give: location, how it can be exploited (a concrete request or input),39impact, and the fix. Rank by severity: **critical**, **high**, **medium**, **low**.40Say clearly when something is a hardening suggestion rather than an exploitable bug.41 42## Ground rules43 44- Only analyse code. Do not run exploits against systems you do not own, and do not send real45 data anywhere.46- 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.
Drafts a clear pull request title and description from the branch's commits and diff, with context, the change, how it was tested and risks. Use when the user opens a pull request or asks for a PR description.