| name | review-security |
| description | Security review skill. Audits implementation against all 14 OWASP Secure Coding Practices categories. Cross-references spec security requirements. Uses web research to verify unfamiliar patterns. |
| argument-hint | Invoked by Review Coordinator - do not call directly |
review-security - Security Review Skill
This skill is invoked by the Review Coordinator as a subagent. It audits implementation code against the 14 OWASP Secure Coding Practices categories, cross-references the spec's security requirements, and uses web research for unfamiliar patterns.
Input contract (received via subagent prompt):
- Read this SKILL.md file for review instructions.
- Read the specification file to extract security requirements (Section 10.2).
- Read the WP file to identify what was implemented and scope the review.
- Discover and read all implementation code relevant to this WP. Use
#tool:search/usages to trace security-relevant symbols (auth functions, crypto methods, input validators). Use #tool:read/problems to scan for compile and lint errors that may indicate security issues.
- Evaluate each OWASP checklist item below against the discovered code.
- Write structured findings to the specified output path.
- Return a brief summary (counts of PASS/WARN/FAIL/N/A).
Constraints:
- Do NOT modify any source code, the WP file, or the spec file.
- Do NOT execute any code from the codebase - review is static analysis only (NFR-004).
- Do NOT reproduce actual secret values (API keys, tokens, passwords) in findings - cite file and line only (NFR-005).
OWASP Secure Coding Practices Checklist
For each category, evaluate all applicable items. Mark items N/A with justification if they do not apply to the codebase.
Category 1: Input Validation
Category 2: Output Encoding
Category 3: Authentication and Password Management
Category 4: Session Management
Category 5: Access Control
Category 6: Cryptographic Practices
Category 7: Error Handling and Logging
Category 8: Data Protection
Category 9: Communication Security
Category 10: System Configuration
Category 11: Database Security
Category 12: File Management
Category 13: Memory Management
Note: Many items in this category are N/A for high-level languages (Python, JavaScript, etc.). Mark as N/A with justification: "Managed language - memory handled by runtime."
Category 14: General Coding Practices
Spec Security Cross-Reference
After completing the OWASP checklist, cross-reference findings against the spec's security requirements:
- Read the spec's Section 10.2 (Security NFRs).
- For each security NFR, verify the implementation complies.
- Missing security controls specified in the spec produce FAIL findings.
- Security controls found in code but not in the spec are informational (no severity impact).
Web Research
Use #tool:web to verify unfamiliar security patterns when encountered during review.
Trusted domains (only fetch from these):
owasp.org - OWASP guidelines and checklists
nvd.nist.gov - National Vulnerability Database, CVE lookup
- Framework-specific docs (e.g., Django, Express, Flask security guides)
Do NOT fetch arbitrary URLs from the codebase (NFR-006).
If web research fails, record WARN: "Unable to verify against external source" and continue with checklist-based review. Cite the source URL in the evidence field when web research informs a finding.
Severity Rules
| Finding type | Severity |
|---|
| Exploitable vulnerability (SQL injection, XSS, hardcoded secret, missing auth, command injection) | FAIL |
| Missing input validation for user-controlled data | FAIL |
| Missing parameterized queries where SQL is used | FAIL |
| Hardcoded credentials or secrets in source | FAIL |
| Missing authentication on protected resources | FAIL |
| Non-critical security concern (missing cache headers, informational) | WARN |
| Missing HSTS or other optional security headers | WARN |
| Best practice not followed but not directly exploitable | WARN |
| Checklist item verified as correctly implemented | PASS |
| Checklist item not applicable to codebase | N/A (with justification) |
Critical rule: Findings MUST NOT reproduce actual secret values. For hardcoded secrets, cite the file and line and describe what was found (e.g., "API key found as string literal assigned to API_KEY variable") - do NOT include the value.
Output Format
Write findings to the specified output path using this exact format:
YAML Frontmatter
---
skill: review-security
wp: <WP-id>
spec: <spec_path>
reviewed_at: <ISO 8601 timestamp>
status: completed
finding_counts:
pass: <count>
warn: <count>
fail: <count>
na: <count>
files_reviewed:
- <file1>
- <file2>
---
Findings Body
# review-security Findings for <WP-id>
## Summary
<Brief overview: categories evaluated, overall security posture, key concerns.>
## Findings
### SEC-001 [FAIL]
- **Checklist item**: Database Security - Parameterized queries
- **Requirement**: OWASP SCP 2.11
- **File**: <file_path>#L<start>-L<end>
- **Description**: <What was found>
- **Expected**: <What should be true>
- **Evidence**:
```
SEC-002 [PASS]
- Checklist item: Input Validation - Server-side validation
- Requirement: OWASP SCP 2.1
- File: <file_path>
- Description:
SEC-003 [N/A]
- Checklist item: Memory Management - Buffer checks
- Justification: Python application - memory managed by runtime.
### Rules
- Finding IDs use prefix `SEC-` and are sequential: SEC-001, SEC-002, etc. No gaps.
- Every FAIL/WARN finding MUST include: Checklist item, Requirement, File (with line range), Description, Expected, Evidence.
- Every PASS finding MUST include: Checklist item, Requirement, File, Description.
- Every N/A finding MUST include: Checklist item, Justification.
- `finding_counts` MUST accurately reflect the actual findings in the file.
- `files_reviewed` MUST list every file read and evaluated during this review.
---
## Quality Checklist
Before completing, verify:
- [ ] All 14 OWASP Secure Coding Practices categories evaluated
- [ ] Spec security requirements cross-referenced
- [ ] Input validation checked at all system boundaries
- [ ] Authentication/authorization verified for all protected endpoints
- [ ] Sensitive data exposure checked (logs, errors, responses)
- [ ] `finding_counts` match actual findings in the output
- [ ] `files_reviewed` lists every file read during this review