Security Reviewer Skill
Core Philosophy
"Assume compromise; verify trust boundaries and input handling."
Focus on exploitable issues and insecure patterns. Prioritize by impact and likelihood.
Scope Boundary: Security-reviewer owns vulnerabilities, authentication/authorization, cryptography, sensitive data exposure, injection, and security configuration. For correctness, readability, maintainability, and code conventions, defer to the code-reviewer skill.
Protocol
1. Scope
- Identify trust boundaries (user input, network, filesystem, third-party services, cloud services).
- Trace sensitive data (secrets, tokens, PII, financial data, health data) from source to sink.
- Check for data leakage in logs, errors, debug endpoints, and API responses.
- Review authentication, authorization, and session handling.
- Assess injection points and unsafe deserialization.
- Evaluate file upload/download security.
- Check cryptographic implementations and key management.
- Review API security and rate limiting.
- Assess third-party dependency vulnerabilities.
2. Common Vulnerability Classes
See VULNERABILITIES.md for comprehensive reference of 27 vulnerability classes including:
- Injection (SQL, NoSQL, Command, XSS)
- Authentication/Authorization (IDOR, privilege escalation)
- Data Leaks (logs, errors, stack traces)
- Cryptography (weak algorithms, hardcoded keys)
- Configuration (debug mode, CORS, security headers)
- API Security (missing auth, over-fetching)
- And 21 more classes...
3. Severity
- Critical – Direct path to compromise or data breach; fix before release.
- High – Significant risk; should be fixed or explicitly accepted with mitigation.
- Medium – Moderate risk; should be addressed but may be deferred with mitigation.
- Low / Info – Minor risk or informational; good to fix but not blocking.
4. Output Format
## Summary
[Brief overview of findings]
## Critical
- **[Title]** - [Location] - [Description and remediation]
## High
- **[Title]** - [Location] - [Description and remediation]
## Medium
- **[Title]** - [Location] - [Description and remediation]
## Low / Info
- **[Title]** - [Location] - [Description and remediation]
## Positive notes (optional)
- [Security practices done well]
Reference Documents
For detailed information, see:
- VULNERABILITIES.md - 27 vulnerability classes with detection patterns
- SEARCH_PATTERNS.md - Grep/search patterns for security-relevant code
- DATA_LEAKS.md - Comprehensive data leak detection guide (IDOR, multi-tenant, logging, API responses)
- CHECKLIST.md - Complete security review checklist (13 categories)
Quick Start
1. Identify Trust Boundaries
Map where untrusted data enters the system:
- User input (forms, APIs, query params, headers)
- File uploads
- Network requests
- Third-party integrations
2. Trace Sensitive Data
Follow secrets, PII, tokens from source to sink:
- Are they logged?
- Exposed in errors?
- Stored securely?
- Encrypted in transit/at rest?
3. Check Authorization
Test access control:
- Can User A access User B's data (IDOR)?
- Are admin endpoints protected?
- Do GraphQL resolvers validate ownership?
Multi-tenant systems: Verify ALL queries include tenant_id filter.
See DATA_LEAKS.md for complete testing strategy.
4. Search for Patterns
Use grep/ripgrep to find security-relevant code:
# Secrets
grep -ri "password\|secret\|api_key\|token" .
# Injection
grep -ri "execute\|query\|SQL\|WHERE\|SELECT" .
# XSS
grep -ri "innerHTML\|dangerouslySetInnerHTML" .
See SEARCH_PATTERNS.md for complete search commands.
5. Review Findings Against Checklist
Use CHECKLIST.md to ensure comprehensive coverage:
- Input & trust boundaries
- Data protection
- Authentication & authorization
- Injection & code execution
- API & network security
- Cryptography
- Configuration
- Dependencies
- Multi-tenant isolation (if applicable)
Common Vulnerability Classes (Quick Reference)
| Class |
Look For |
| Injection |
SQL, NoSQL, command, template injection |
| XSS |
innerHTML, dangerouslySetInnerHTML, unsafe DOM |
| Auth/Authz |
Weak credentials, IDOR, missing checks |
| Data Leak |
Logs, errors, stack traces with secrets/PII |
| Crypto |
MD5, SHA1, DES, RC4, hardcoded keys |
| SSRF |
User-controlled URLs, webhooks |
| File Upload |
No type/size limits, path traversal |
See VULNERABILITIES.md for complete reference (27 classes).
Data Leak Detection (Critical)
Data leaks are the most common security issue. Check:
- Unauthorized access - IDOR vulnerabilities
- Multi-tenant isolation - Tenant A accessing Tenant B's data
- Logging - Secrets, PII in logs
- API responses - Over-fetching, internal fields
- Error messages - Stack traces, verbose errors
- Frontend - Secrets in JS bundles, console.log
See DATA_LEAKS.md for:
- 9 data leak vectors
- Detection strategy (10-step process)
- Remediation patterns
- Multi-tenant isolation best practices
Search Patterns (Quick Reference)
# Secrets
grep -ri "password\|secret\|api_key\|token\|credentials" .
# Data leaks
grep -ri "console.log\|printStackTrace\|error.stack" .
# Injection
grep -ri "execute\|eval\|exec\|query\|SQL" .
# XSS
grep -ri "innerHTML\|dangerouslySetInnerHTML\|v-html" .
# Authorization
grep -ri "user_id\|userId\|owner_id\|tenant_id" .
See SEARCH_PATTERNS.md for complete patterns by category.
Standards Reference
- OWASP Top 10 2021
- OWASP API Security Top 10
- CWE Top 25 Most Dangerous Software Weaknesses
- Project-specific security documentation or threat model
Checklist
Before completing security review, verify:
See CHECKLIST.md for complete 13-category checklist.
Cross-Skill Integration
| Situation |
Skill to invoke |
How |
| Need code review (non-security) |
code-reviewer skill |
Read skills/code-reviewer/SKILL.md |
| Need to fix identified issues |
developer skill |
Read skills/developer/SKILL.md |
| Testing security fixes |
testing skill |
Read skills/testing/SKILL.md |
| Security in architecture phase |
architect skill |
Read skills/architect/SKILL.md |
| CI/CD security checks |
ci-cd skill |
Read skills/ci-cd/SKILL.md |
| Dependency vulnerabilities |
dependencies skill |
Read skills/dependencies/SKILL.md |
1---2name: security-reviewer3description: Review code and design for security vulnerabilities and insecure patterns. Use when the user asks for a security review, security audit, find vulnerabilities, or when assessing auth, crypto, input handling, or exposure of sensitive data.4---56# Security Reviewer Skill78## Core Philosophy910**"Assume compromise; verify trust boundaries and input handling."**1112Focus on exploitable issues and insecure patterns. Prioritize by impact and likelihood.1314**Scope Boundary:** Security-reviewer owns **vulnerabilities, authentication/authorization, cryptography, sensitive data exposure, injection, and security configuration**. For correctness, readability, maintainability, and code conventions, defer to the **code-reviewer** skill.1516---1718## Protocol1920### 1. Scope2122- Identify trust boundaries (user input, network, filesystem, third-party services, cloud services).23- Trace sensitive data (secrets, tokens, PII, financial data, health data) from source to sink.24- Check for data leakage in logs, errors, debug endpoints, and API responses.25- Review authentication, authorization, and session handling.26- Assess injection points and unsafe deserialization.27- Evaluate file upload/download security.28- Check cryptographic implementations and key management.29- Review API security and rate limiting.30- Assess third-party dependency vulnerabilities.3132### 2. Common Vulnerability Classes3334See **[VULNERABILITIES.md](VULNERABILITIES.md)** for comprehensive reference of 27 vulnerability classes including:35- Injection (SQL, NoSQL, Command, XSS)36- Authentication/Authorization (IDOR, privilege escalation)37- Data Leaks (logs, errors, stack traces)38- Cryptography (weak algorithms, hardcoded keys)39- Configuration (debug mode, CORS, security headers)40- API Security (missing auth, over-fetching)41- And 21 more classes...4243### 3. Severity4445- **Critical** – Direct path to compromise or data breach; fix before release.46- **High** – Significant risk; should be fixed or explicitly accepted with mitigation.47- **Medium** – Moderate risk; should be addressed but may be deferred with mitigation.48- **Low / Info** – Minor risk or informational; good to fix but not blocking.4950### 4. Output Format5152```markdown53## Summary54[Brief overview of findings]5556## Critical57- **[Title]** - [Location] - [Description and remediation]5859## High60- **[Title]** - [Location] - [Description and remediation]6162## Medium63- **[Title]** - [Location] - [Description and remediation]6465## Low / Info66- **[Title]** - [Location] - [Description and remediation]6768## Positive notes (optional)69- [Security practices done well]70```7172---7374## Reference Documents7576For detailed information, see:7778- **[VULNERABILITIES.md](VULNERABILITIES.md)** - 27 vulnerability classes with detection patterns79- **[SEARCH_PATTERNS.md](SEARCH_PATTERNS.md)** - Grep/search patterns for security-relevant code80- **[DATA_LEAKS.md](DATA_LEAKS.md)** - Comprehensive data leak detection guide (IDOR, multi-tenant, logging, API responses)81- **[CHECKLIST.md](CHECKLIST.md)** - Complete security review checklist (13 categories)8283---8485## Quick Start8687### 1. Identify Trust Boundaries8889Map where untrusted data enters the system:90- User input (forms, APIs, query params, headers)91- File uploads92- Network requests93- Third-party integrations9495### 2. Trace Sensitive Data9697Follow secrets, PII, tokens from source to sink:98- Are they logged?99- Exposed in errors?100- Stored securely?101- Encrypted in transit/at rest?102103### 3. Check Authorization104105Test access control:106- Can User A access User B's data (IDOR)?107- Are admin endpoints protected?108- Do GraphQL resolvers validate ownership?109110**Multi-tenant systems:** Verify ALL queries include `tenant_id` filter.111112See [DATA_LEAKS.md](DATA_LEAKS.md) for complete testing strategy.113114### 4. Search for Patterns115116Use grep/ripgrep to find security-relevant code:117```bash118# Secrets119grep -ri "password\|secret\|api_key\|token" .120121# Injection122grep -ri "execute\|query\|SQL\|WHERE\|SELECT" .123124# XSS125grep -ri "innerHTML\|dangerouslySetInnerHTML" .126```127128See [SEARCH_PATTERNS.md](SEARCH_PATTERNS.md) for complete search commands.129130### 5. Review Findings Against Checklist131132Use [CHECKLIST.md](CHECKLIST.md) to ensure comprehensive coverage:133- Input & trust boundaries134- Data protection135- Authentication & authorization136- Injection & code execution137- API & network security138- Cryptography139- Configuration140- Dependencies141- Multi-tenant isolation (if applicable)142143---144145## Common Vulnerability Classes (Quick Reference)146147| Class | Look For |148|-------|----------|149| **Injection** | SQL, NoSQL, command, template injection |150| **XSS** | innerHTML, dangerouslySetInnerHTML, unsafe DOM |151| **Auth/Authz** | Weak credentials, IDOR, missing checks |152| **Data Leak** | Logs, errors, stack traces with secrets/PII |153| **Crypto** | MD5, SHA1, DES, RC4, hardcoded keys |154| **SSRF** | User-controlled URLs, webhooks |155| **File Upload** | No type/size limits, path traversal |156157See [VULNERABILITIES.md](VULNERABILITIES.md) for complete reference (27 classes).158159---160161## Data Leak Detection (Critical)162163Data leaks are the most common security issue. Check:1641651. **Unauthorized access** - IDOR vulnerabilities1662. **Multi-tenant isolation** - Tenant A accessing Tenant B's data1673. **Logging** - Secrets, PII in logs1684. **API responses** - Over-fetching, internal fields1695. **Error messages** - Stack traces, verbose errors1706. **Frontend** - Secrets in JS bundles, console.log171172See [DATA_LEAKS.md](DATA_LEAKS.md) for:173- 9 data leak vectors174- Detection strategy (10-step process)175- Remediation patterns176- Multi-tenant isolation best practices177178---179180## Search Patterns (Quick Reference)181182```bash183# Secrets184grep -ri "password\|secret\|api_key\|token\|credentials" .185186# Data leaks187grep -ri "console.log\|printStackTrace\|error.stack" .188189# Injection190grep -ri "execute\|eval\|exec\|query\|SQL" .191192# XSS193grep -ri "innerHTML\|dangerouslySetInnerHTML\|v-html" .194195# Authorization196grep -ri "user_id\|userId\|owner_id\|tenant_id" .197```198199See [SEARCH_PATTERNS.md](SEARCH_PATTERNS.md) for complete patterns by category.200201---202203## Standards Reference204205- **OWASP Top 10 2021**206- **OWASP API Security Top 10**207- **CWE Top 25 Most Dangerous Software Weaknesses**208- **Project-specific security documentation or threat model**209210---211212## Checklist213214Before completing security review, verify:215216- [ ] Trust boundaries identified and validated217- [ ] Sensitive data flow traced (no leaks in logs/errors)218- [ ] Authorization enforced on all operations (IDOR checked)219- [ ] Injection vulnerabilities prevented220- [ ] API security reviewed (rate limiting, SSRF)221- [ ] Cryptography uses strong algorithms222- [ ] Configuration secure (no debug mode in prod)223- [ ] Dependencies scanned for vulnerabilities224- [ ] Multi-tenant isolation verified (if applicable)225- [ ] Findings include severity and remediation226227See [CHECKLIST.md](CHECKLIST.md) for complete 13-category checklist.228229---230231## Cross-Skill Integration232233| Situation | Skill to invoke | How |234|-----------|----------------|-----|235| Need code review (non-security) | **code-reviewer** skill | Read `skills/code-reviewer/SKILL.md` |236| Need to fix identified issues | **developer** skill | Read `skills/developer/SKILL.md` |237| Testing security fixes | **testing** skill | Read `skills/testing/SKILL.md` |238| Security in architecture phase | **architect** skill | Read `skills/architect/SKILL.md` |239| CI/CD security checks | **ci-cd** skill | Read `skills/ci-cd/SKILL.md` |240| Dependency vulnerabilities | **dependencies** skill | Read `skills/dependencies/SKILL.md` |