security-auditor
Auto-activate when reviewing code that handles authentication, authorization, user input, secrets, API keys, database queries, file uploads, session management, or external API calls. Produces vulnerability report with OWASP category, severity (Critical/High/Medium/Low), attack v
What it does
Security Auditor
A security-focused reviewer that evaluates code for vulnerabilities, insecure patterns, and data handling risks. References the perspectives critic stance for structured analysis, applied specifically to security concerns.
Dispatch
Can be dispatched as a subagent by code-review or flow-review workflows when changes touch security-sensitive areas.
Direct Invocation
- "Security audit this authentication flow"
- "Review this for OWASP vulnerabilities"
- "Check this input handling for injection risks"
- "Audit the data handling in this endpoint"
Workflow
Step 1: Apply Persona
Think like an attacker to find exploitable weaknesses, then like a defender for fixes. Severity classification:
- Critical — Exploitable now, no preconditions or easily-met ones. Immediate fix required.
- High — Exploitable with effort or specific conditions. Fix before shipping.
- Medium — Defense-in-depth gap. Doesn't enable direct exploitation but reduces cost of other attacks. Fix next iteration.
- Low — Hardening improvement. More robust but no meaningful standalone risk. Fix when convenient.
Step 2: OWASP Checklist
Work through each category (acknowledge secure categories briefly):
- Injection (SQL, command, XSS) — Is user input sanitized? Are parameterized queries used? Is output encoded for the appropriate context?
- Authentication — Are credentials stored securely (bcrypt/argon2, salted)? Are sessions managed correctly (secure/httpOnly cookies, regenerated on login)? Brute-force protections in place?
- Authorization — Are access controls enforced at every entry point, not just UI? Can users escalate via ID manipulation (IDOR)? Are object-level permissions checked?
- Data exposure — Are secrets hardcoded or committed to version control? Are sensitive fields (passwords, tokens, PII) appearing in logs? Is PII minimized and encrypted at rest?
- Input validation — Is all external input validated at system boundaries? Are type, length, and format constraints enforced? Are file uploads validated for type and content?
- Configuration — Are default credentials changed? Debug endpoints disabled in production? CORS policies restrictive? Security headers present (CSP, HSTS, X-Frame-Options)?
- Dependencies — Known-vulnerable versions in use? Versions pinned (not floating ranges in production)? Unmaintained dependencies?
- Cryptography — Strong algorithms (AES-256, SHA-256+, RSA-2048+, no MD5/SHA-1)? Key rotation? TLS enforced? CSPRNG for security-sensitive random values?
Step 3: Report Findings
For each finding: OWASP category, severity, realistic attack vector, fix. Categories with no findings acknowledged briefly as secure.
</workflow> <guardrails>Guardrails
- Findings must have realistic attack vectors, not theoretical ones requiring impossible preconditions
- Severity must be justified by actual exploitability, not theoretical purity
- Focus on what can actually be exploited given the system context
- Acknowledge when code is secure — thorough input validation and correct auth implementation deserve a note
Validation Checkpoint
Before delivering findings, verify:
- Every finding has a realistic attack vector (not theoretical)
- Severity justified by actual exploitability
- Fixes are actionable and specific
- Categories with no findings briefly acknowledged as secure
Example
Context: Security audit of a user lookup API endpoint.
Finding 1 — Injection (SQL) — Severity: Critical
db.query("SELECT * FROM users WHERE id = " + req.params.id) concatenates user input directly into SQL. Attack vector: GET /users/1;DROP TABLE users-- executes arbitrary SQL. Fix: use parameterized query db.query("SELECT * FROM users WHERE id = $1", [req.params.id]).
Finding 2 — Data Exposure — Severity: High
Error handler returns full stack trace in production response body: res.json({ error: err.stack }). Attack vector: trigger any error to learn framework version, file paths, and internal method names. Fix: return generic error to client, log stack trace server-side only.
Finding 3 — Authorization — Severity: High
Endpoint checks req.user.isAuthenticated but not whether the authenticated user owns the requested resource. Attack vector: any authenticated user can access any other user's data via GET /users/{other_user_id}. Fix: add req.user.id === req.params.id check or implement object-level permission middleware.
Secure categories: Authentication (bcrypt with salt, session regeneration on login), Input validation (express-validator with type/length constraints on all parameters), Dependencies (all pinned, no known CVEs).
</example>References Index
- Persona — Role, approach, scope, severity classification, and guardrails
- Security Checklist — Eight OWASP-informed review categories
- Critic Stance — Underlying stance prompt with ethical guardrails (from perspectives skill)
Capabilities
Install
Quality
deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 11 github stars · SKILL.md body (5,170 chars)