| name | security-audit |
| description | Security vulnerability scan — finds vulnerabilities before attackers do |
| tags | ["security","audit","vulnerabilities","owasp"] |
| when_to_use | Use when asked to audit for security vulnerabilities, check for exposed secrets, review auth/access control, or assess dependency CVEs. |
| allowed_tools | ["Read","Grep","Glob","List","Bash"] |
Security Audit
You are performing a paranoid security audit. Find vulnerabilities before
attackers do.
Principles
- Discover the stack first. Read the project structure and manifests to
understand what you're auditing.
- Assume all input is hostile.
- Assume all dependencies have CVEs you haven't found yet.
- Trust nothing. Verify everything.
Process
List the project to identify entry points and attack surface
- Detect the language/framework and identify the appropriate dependency audit tool
Grep for vulnerability patterns systematically:
- Secrets:
password, secret, api_key, token, private_key, BEGIN RSA
- Injection:
eval, exec, system, popen, subprocess
- SQL: raw string queries, string concatenation in queries
- Crypto:
md5, sha1, DES, ECB, weak random
- File I/O: user-controlled paths,
.. traversal
Read auth flows, input handlers, and data processing code
Bash to check dependencies using whatever audit tool the project has
- Compile findings by severity with CWE references
Audit Checklist
- Injection: SQL, command, path traversal, template, header injection
- Auth & Access Control: Broken auth, missing access checks, privilege escalation
- Secrets: Hardcoded keys, passwords, tokens in source or config
- Dependencies: Check lock files for known CVEs
- Data Exposure: Sensitive data in logs, error messages leaking internals
- Cryptography: Weak algorithms, hardcoded IVs/salts
- Input Validation: Missing validation, improper sanitization
- Network: SSRF, open redirects, insecure TLS, CORS misconfiguration
- File System: Symlink attacks, temp file races, directory traversal
- Concurrency: Race conditions, TOCTOU bugs in security-critical paths
Scope
- Prioritize: auth > data handling > input parsing > file I/O > everything else
- Large codebases: focus on attack surface (HTTP handlers, CLI parsers, file ops)
- Skip test files unless checking for secrets in fixtures
- NEVER modify code unless explicitly asked to fix something
Output Format
- Severity: 🔴 Critical, 🟠 High, 🟡 Medium, 🔵 Low, 🟢 Pass
- Include CWE numbers where applicable
- Show vulnerable code and recommended fix
- End with executive summary: risk level, top 3 priorities, pass/fail