security-review
A checklist for reviewing code that handles user input, authentication, secrets, or network requests.
Invoke as: /security-review
Trigger: reviewing code for security issues, auditing a PR, checking for vulnerabilities.
Checklist
Section titled “Checklist”Injection
Section titled “Injection”- No SQL built with string concatenation — use parameterized queries
- No shell commands built from user input — avoid
exec/spawnwith interpolated strings - No
eval()ornew Function()with user-controlled strings
Authentication and secrets
Section titled “Authentication and secrets”- Secrets loaded from environment variables, never hardcoded
- No secrets in log output (even at debug level)
- No secrets committed to git (check
.env*, config files, test fixtures) - Tokens not stored in
localStorageor cookies withouthttpOnly/Secure
Input validation
Section titled “Input validation”- All external input validated at the boundary (HTTP body, CLI args, env vars)
- File paths from user input sanitized against path traversal (
../) - File uploads restricted by type and size
Dependencies
Section titled “Dependencies”-
pnpm auditpasses (no critical/high vulnerabilities) - New dependencies are from reputable, actively maintained sources
Output / XSS
Section titled “Output / XSS”- User content rendered in HTML is escaped
- No
dangerouslySetInnerHTMLwith unsanitized input - Content-Security-Policy headers set where applicable
Node.js specific
Section titled “Node.js specific”-
child_processcalls use the array form ofexec/spawn -
fsoperations validate that resolved paths stay within expected directories - Rate limiting on endpoints that accept user input
Escalation
Section titled “Escalation”If you find a critical vulnerability (data exposure, auth bypass, RCE), stop implementation and report it immediately rather than fixing it inline.