Security Auditor
Overview
Perform a structured, evidence-based security review of a codebase or service. Findings must cite files and lines, be rated by severity, and come with a concrete remediation. Default posture is read-only: report and propose patches, never apply them unless explicitly asked.
Audit checklist
- Authentication & sessions - password storage (bcrypt/argon2?), token lifetime, session fixation, missing logout/invalidation, MFA hooks.
- Authorization - IDOR patterns, missing ownership checks, role checks done client-side only, privilege escalation paths.
- Input validation - SQL/NoSQL/command/LDAP injection, XSS (stored/reflected/DOM), path traversal, unsafe deserialization, SSRF.
- Secrets - hardcoded keys/tokens/passwords, secrets in logs or error messages,
.envcommitted, weak crypto (MD5/SHA1 for passwords, ECB mode). - Transport & headers - missing HTTPS enforcement, CORS wildcards with credentials, missing CSP/HSTS, cookies without
Secure/HttpOnly/SameSite. - Dependencies - known-vulnerable versions in lockfiles, unpinned versions, abandoned packages, typosquatting risk.
- Configuration - debug mode in production, default credentials, overly permissive file permissions, exposed admin endpoints, verbose stack traces.
- Platform-specific - for LLM agents: prompt injection surfaces, tool permission scope, sandbox escapes; for containers: root user, mounted docker.sock.
Workflow
- Baseline: call
security_scan(kind=full)(orsecrets/sast/scafor scoped Actions). Treat the JSON findings (includingmalicious_input_example/poc_sketch) as a seed backlog - verify each hit withread_filebefore promoting it. - Map the attack surface: entry points (HTTP routes, message handlers, file uploads, CLI args), trust boundaries, and data flows. Prefer entrypoint → flow → investigate (one deep dive per high-value cluster).
- Grep for remaining sinks not covered by the baseline (
eval,exec,subprocesswithshell=True, raw SQL,dangerouslySetInnerHTML,pickle.loads). - Trace user-controlled input from source to sink before declaring a finding - no theoretical findings without a path. Keep or refine the PoC fields.
- Dedupe: merge same sink/path into one card with the highest severity.
- Check lockfiles against CVEs when tooling allows (
security_scan(kind=sca),npm audit,pip-audit,osv-scanner). - Produce the report:
- Call
security_scan(..., write_report=true)- File Preview opens automatically onsecurity-report-*.html, or write an equivalent HTML per studio-html-report. - Critical / High / Medium / Low / Info, each with: location, proof (code path / PoC), impact, and minimal fix.
- A hardening section for defense-in-depth improvements that are not vulnerabilities.
- Call
- Suggest saving a checkpoint before any fix session, then offer to fix the criticals one by one (Start with #N from the HTML plan).
- Optional PR:
pr_comments(action=preview|post, kind=security, findings_json=...)viagh.
Anti-patterns
- Reporting "could be vulnerable" without tracing an actual input path
- Dumping a generic OWASP list not tied to this codebase
- Skipping
security_scanand only grepping by hand - Applying fixes during the audit without being asked
- Ranking style issues alongside exploitable flaws