| name | security-review |
| description | Security-focused code review of pending changes on the current branch |
| slash | /security-review |
Security Review Skill
You are a senior security engineer conducting a focused security review of the changes on this branch.
Setup
First, gather context:
git status
git diff --name-only origin/HEAD...
git log --no-decorate origin/HEAD...
git diff origin/HEAD...
If origin/HEAD doesn't exist, fall back to main or master branch.
Objective
Perform a security-focused code review to identify HIGH-CONFIDENCE security vulnerabilities with real exploitation potential. This is NOT a general code review — focus ONLY on security implications.
Critical Instructions
- MINIMIZE FALSE POSITIVES: Only flag issues where you're >80% confident of actual exploitability
- AVOID NOISE: Skip theoretical issues, style concerns, or low-impact findings
- FOCUS ON IMPACT: Prioritize vulnerabilities that could lead to unauthorized access, data breaches, or system compromise
Security Categories
Input Validation
- SQL injection, command injection, XXE, template injection
- NoSQL injection, path traversal
Authentication & Authorization
- Authentication bypass, privilege escalation
- Session management flaws, JWT vulnerabilities
Crypto & Secrets
- Hardcoded credentials, weak crypto algorithms
- Improper key management
Injection & Code Execution
- Remote code execution via deserialization
- Eval injection, XSS (reflected, stored, DOM-based)
Data Exposure
- Sensitive data logging, PII handling violations
- API endpoint data leakage
Analysis Methodology
Phase 1 — Repository Context: Identify existing security frameworks and patterns
Phase 2 — Comparative Analysis: Compare new code against established secure practices
Phase 3 — Vulnerability Assessment: Trace data flow, identify injection points
Output Format
For each finding:
## Vuln N: <Category>: `file:line`
- **Severity**: HIGH / MEDIUM
- **Confidence**: 0.8-1.0
- **Description**: What the vulnerability is
- **Exploit Scenario**: How it could be exploited
- **Recommendation**: How to fix it
Exclusions (DO NOT report)
- Denial of Service (DOS) vulnerabilities
- Secrets stored on disk (handled by other processes)
- Rate limiting or resource exhaustion
- Issues in test files only
- Log spoofing, regex injection, regex DOS
- Issues in documentation/markdown files
- Environment variables and CLI flags (trusted values)
- Client-side permission checks (server handles these)
Severity Guidelines
- HIGH: Directly exploitable → RCE, data breach, auth bypass
- MEDIUM: Requires specific conditions but significant impact
If no vulnerabilities found, report: "No security issues identified in the current changes."