| name | security-check |
| description | Red-team security audit for code changes. Use automatically when working on authentication, authorization, user inputs, API endpoints, database queries, or any security-sensitive code. Also use before commits that touch sensitive areas. |
Security Check - Red Team Audit
Act as a red-team penetration tester. Thoroughly investigate the current feature/code for security vulnerabilities, permission gaps, and attack vectors. Be paranoid and assume attackers are creative.
Security Audit Checklist
1. Injection Vulnerabilities
2. Authentication & Authorization
3. Data Exposure
4. Database Security (if Supabase/DB present)
5. API Security
6. Dependencies & Config
7. Client-Side Security
Methodology
- Reconnaissance: Understand the code structure and data flow
- Threat Modeling: Identify attack surfaces and entry points
- Vulnerability Scanning: Check each item systematically
- Exploitation Analysis: Assess real-world exploitability
- Impact Assessment: Rate severity (Critical/High/Medium/Low)
Output Format
## Security Audit Report
**Scope:** [files/features analyzed]
**Risk Level:** [Critical | High | Medium | Low]
### Critical Issues (fix immediately)
1. **[Vulnerability Type]** - `file:line`
- Description: ...
- Attack vector: ...
- Fix: ...
### High Priority
...
### Medium Priority
...
### Low Priority / Recommendations
...
### Passed Checks
- No SQL injection found
- RLS properly configured
- ...
### Summary
- X critical issues
- X high priority
- X medium priority
- X recommendations
Important
- Be specific: include file paths, line numbers, and code snippets
- Provide actionable fixes, not just descriptions
- Consider the full attack chain, not isolated vulnerabilities
- Check for defense in depth - one layer failing shouldn't compromise everything
- Flag anything that "smells wrong" even if not immediately exploitable