Security review process and vulnerability prevention. Use when reviewing code for security issues, implementing authentication or authorization, handling user input or secrets, adding API endpoints, or approving code that touches security boundaries. Also use for OWASP Top 10 analysis, secret scanning, dependency auditing, or when code handles forms, file uploads, sessions, tokens, database queries, or shell commands. Essential when someone says 'it's just a small change.'
Security issues are cheap to prevent, expensive to fix after deployment. This skill guides systematic security review before code ships.
Core principle: Every code change is a potential security change. Review security implications BEFORE approving.
Before reviewing code details, identify what's at risk:
Data Classification
Trust Boundaries
Attack Surface
Check for common vulnerability patterns:
Injection Points (CRITICAL - check first)
references/owasp-top-10.md for patternsAuthentication/Authorization
references/auth-patterns.md for secure patternsSecrets Management
references/secrets-guide.md for detection patternsData Exposure
Before approving:
Test Security Controls
Review Dependencies
npm audit / pip-audit / govulncheckCheck Configuration
If you see ANY of these, STOP and investigate before proceeding:
- String concatenation in SQL: f"SELECT * FROM users WHERE id = '{id}'"
- eval() or exec() with any external input
- innerHTML with user-controlled content
- Hardcoded secrets: API_KEY = "sk-live-..."
- Missing authentication on sensitive endpoints
- Shell commands with user input: os.system(f"ls {path}")
- Disabling security features: verify=False, --no-verify
- Broad CORS: Access-Control-Allow-Origin: *
- Elevated privileges: running as root, admin endpoints
- Cryptographic operations (easy to get wrong)
- Custom auth implementations (use standard libraries)
- Base64 "encoding" treated as encryption
- MD5/SHA1 for passwords (use bcrypt/argon2)
- JWT with 'none' algorithm or long expiry
- Catching and silencing all exceptions
- Comments like "TODO: add auth later"
| Excuse | Reality |
|---|---|
| "It's internal only" | Internal apps get compromised. Apply same standards. |
| "We'll add security later" | Later never comes. Security debt compounds. |
| "It's behind a firewall" | Defense in depth. Assume firewall fails. |
| "Only admins use this" | Admin credentials get stolen. Validate anyway. |
| "The framework handles it" | Frameworks have defaults. Verify they're secure. |
| "It's just for testing" | Test code ships to production. It happens. |
| "We trust this input" | Trust is a vulnerability. Validate everything. |
Before approving ANY code change:
npm audit clean)# Secret scanning
gitleaks detect --source .
trufflehog filesystem .
# Dependency audit
npm audit # Node.js
pip-audit # Python
govulncheck ./... # Go
cargo audit # Rust
# SAST scanning
semgrep --config auto .
bandit -r src/ # Python
gosec ./... # Go
Detailed patterns and examples in references/:
owasp-top-10.md - Top 10 vulnerabilities with code examplesauth-patterns.md - Secure authentication implementationsecrets-guide.md - Secret detection and managementsecurity-headers.md - HTTP security header configuration