Reviewing Security
Security Reviewer Process
Read the diff. Run git diff HEAD~1 (or the applicable range) to see
what changed.
Identify the attack surface. Determine what the changed code touches:
user input, authentication, authorization, data storage, external services,
file system, command execution, serialization, or network communication.
Apply OWASP Top 10 checks to every changed file:
- Injection — SQL, NoSQL, OS command, LDAP. Is user input interpolated
into queries or commands without parameterization?
- Broken Authentication — Weak password handling, missing rate limiting,
session fixation, credential exposure in logs.
- Sensitive Data Exposure — Secrets in code, PII in logs, missing
encryption, overly broad API responses.
- XSS — User input rendered without escaping in HTML, JavaScript, or
template contexts.
- CSRF — State-changing operations without token validation.
- Insecure Deserialization — Untrusted data passed to deserializers
without validation.
- Missing Access Control — Authorization checks absent or bypassable,
IDOR vulnerabilities, privilege escalation paths.
- Security Misconfiguration — Debug mode in production, overly
permissive CORS, missing security headers, default credentials.
Check for more vulnerabilities:
- Hardcoded secrets — API keys, passwords, tokens, connection strings
in source code or configuration committed to version control.
- Command injection — User input passed to shell execution,
exec,
spawn, or eval without sanitization.
- Path traversal — User-controlled input used in file paths without
validation (e.g.,
../../../etc/passwd).
- Unsafe regex — Regular expressions vulnerable to ReDoS (catastrophic
backtracking with user-controlled input).
- Missing input validation — Data crossing system boundaries (HTTP
requests, file uploads, environment variables) without schema validation
or sanitization.
Search beyond the diff. If the diff introduces a pattern that could be
vulnerable, grep the broader codebase for similar patterns.
Security Severity Classification
CRITICAL — Hard Gate
The code MUST NOT ship with these findings. Examples:
- Hardcoded secrets or credentials
- SQL/command injection with user-controlled input
- Authentication bypass
- Missing authorization on sensitive endpoints
HIGH — Hard Gate
The code MUST NOT ship with these findings. Examples:
- XSS in user-facing output
- CSRF on state-changing endpoints
- Sensitive data in logs
MEDIUM
Moderate risk, should be addressed soon. Examples:
- Overly permissive CORS configuration
- Missing rate limiting on auth endpoints
- Weak cryptographic choices
LOW
Minor risk or defense-in-depth improvement. Examples:
- Missing security headers on non-sensitive endpoints
- Informational leakage in error messages
1---2name: reviewing-security3description: Defines threat and OWASP review with evidence-rated findings. Load when reviewing a diff for security defects.4---56# Reviewing Security78## Security Reviewer Process9101. **Read the diff.** Run `git diff HEAD~1` (or the applicable range) to see11 what changed.12132. **Identify the attack surface.** Determine what the changed code touches:14 user input, authentication, authorization, data storage, external services,15 file system, command execution, serialization, or network communication.16173. **Apply OWASP Top 10 checks** to every changed file:18 - **Injection** — SQL, NoSQL, OS command, LDAP. Is user input interpolated19 into queries or commands without parameterization?20 - **Broken Authentication** — Weak password handling, missing rate limiting,21 session fixation, credential exposure in logs.22 - **Sensitive Data Exposure** — Secrets in code, PII in logs, missing23 encryption, overly broad API responses.24 - **XSS** — User input rendered without escaping in HTML, JavaScript, or25 template contexts.26 - **CSRF** — State-changing operations without token validation.27 - **Insecure Deserialization** — Untrusted data passed to deserializers28 without validation.29 - **Missing Access Control** — Authorization checks absent or bypassable,30 IDOR vulnerabilities, privilege escalation paths.31 - **Security Misconfiguration** — Debug mode in production, overly32 permissive CORS, missing security headers, default credentials.33344. **Check for more vulnerabilities:**35 - **Hardcoded secrets** — API keys, passwords, tokens, connection strings36 in source code or configuration committed to version control.37 - **Command injection** — User input passed to shell execution, `exec`,38 `spawn`, or `eval` without sanitization.39 - **Path traversal** — User-controlled input used in file paths without40 validation (e.g., `../../../etc/passwd`).41 - **Unsafe regex** — Regular expressions vulnerable to ReDoS (catastrophic42 backtracking with user-controlled input).43 - **Missing input validation** — Data crossing system boundaries (HTTP44 requests, file uploads, environment variables) without schema validation45 or sanitization.46475. **Search beyond the diff.** If the diff introduces a pattern that could be48 vulnerable, grep the broader codebase for similar patterns.4950## Security Severity Classification5152### CRITICAL — Hard Gate5354The code MUST NOT ship with these findings. Examples:55- Hardcoded secrets or credentials56- SQL/command injection with user-controlled input57- Authentication bypass58- Missing authorization on sensitive endpoints5960### HIGH — Hard Gate6162The code MUST NOT ship with these findings. Examples:63- XSS in user-facing output64- CSRF on state-changing endpoints65- Sensitive data in logs6667### MEDIUM6869Moderate risk, should be addressed soon. Examples:70- Overly permissive CORS configuration71- Missing rate limiting on auth endpoints72- Weak cryptographic choices7374### LOW7576Minor risk or defense-in-depth improvement. Examples:77- Missing security headers on non-sensitive endpoints78- Informational leakage in error messages