view source

Secure Code Review: OWASP Top 10 and ASVS

skill

Reviews code and config against the OWASP Top 10:2025 and ASVS 5.0: vulnerability assessment, secure-coding fixes, supply-chain audits.

Apache-2.0 Requires: a code checkout. Scanners (npm audit, pip-audit, cargo audit, osv-scanner, semgrep, gitleaks) help when installed.

agents that use this skill

instructions

Overview

This skill reviews application source code and configuration for security flaws against the OWASP Top 10:2025 and ASVS 5.0, and delivers verified findings with fixes. It covers vulnerability assessment, secure-coding remediation, and dependency and supply-chain audits. The outcome is a short list of demonstrated vulnerabilities, each with the fix, and no speculative noise.

Mental model

Security-first development: defense in depth, least privilege, secure and fail-closed defaults, allowlist input validation, context-aware output encoding, authorization on every request, security events logged without sensitive data, and proven crypto libraries only. Simple, readable security code is auditable code. No security through obscurity; delete dead code to shrink the attack surface; comments explain security decisions (why, not what); secure first, optimize later.

Rules

Method

  • Verify a vulnerability exists before reporting it. Report only what you can demonstrate.
  • For existing code, ask whether a finding is a vulnerability or intended behavior.
  • Missing information on the first request: ask briefly, don't guess. "X not working" could mean missing, broken, wrong behavior, or a misunderstanding: clarify first.
  • Not covered here: alert and log triage, phishing analysis, incident investigation, privacy and compliance frameworks, and offensive work (writing an exploit or payload against a system the user isn't authorized on).
  • Multi-step remediation across files, new security controls, and complex fixes get a compact plan (one line per step) that the user confirms before you execute. Pure queries and single-step changes (fix a typo, add a header, update a config value) need no plan.
  • Scope discipline: "fix X" means find X, fix only X, stop. "Investigate Z" means report findings, no changes. No "while I'm here" extras.
  • Finding code: start with AST-pattern search for vulnerable patterns and semantic code search for security-related code. Outline an unfamiliar or large file (over 200 lines) before reading ranges; read a small known file in full. Run independent searches together.
  • Security tools: AST-pattern search finds vulnerable patterns; semantic code search finds security-related code; the shell runs scanners (npm audit, pip-audit, cargo audit, osv-scanner, semgrep, gitleaks, and so on); file reads inspect configuration.

OWASP Top 10:2025: what to look for and the fix

IDCategoryLook forFix
A01Broken Access Control (now includes SSRF)Missing object- or function-level checks (IDOR), privilege escalation, CORS misconfig, server fetching user-supplied URLsDeny by default; authorize every request server-side against the object's owner; URL allowlists and egress limits for server-side fetches
A02Security MisconfigurationDefault creds, debug on, verbose errors, permissive cloud/IAM, XXE-enabled parsers, missing headersHardened repeatable config, IaC review, unused features removed
A03Software Supply Chain FailuresUnpinned or unvetted dependencies, typosquats, hijacked maintainers and self-spreading npm worms, over-privileged CI tokens, no SBOMLockfiles, SBOM, provenance and signing (SLSA, Sigstore), a short cooldown before adopting fresh releases; CI hardening (commit-SHA action pins, least-privilege tokens and secrets) per the ci-cd-pipelines skill
A04Cryptographic FailuresWeak or legacy algorithms, hardcoded secrets, plaintext sensitive data, home-made cryptoVetted libraries, TLS everywhere, KMS or secret manager, Argon2id/scrypt/bcrypt for passwords
A05Injection (incl. XSS)SQL/NoSQL/OS/LDAP/template injection, XSSParameterized queries, context-aware output encoding, CSP, no shell string interpolation
A06Insecure DesignBusiness-logic flaws, no rate limits on sensitive flows, trust-boundary violationsThreat model before building, using the threat-modeling skill; abuse cases as tests
A07Authentication FailuresCredential stuffing, weak recovery flows, session fixation, missing MFAPasskeys or other phishing-resistant MFA; NIST SP 800-63B-4 passwords (length over composition, breached-password check, no forced rotation); rate limits; secure sessions
A08Software or Data Integrity FailuresUnsigned updates, insecure deserialization, trusting unverified dataSignature verification, safe deserialization, integrity checks
A09Security Logging and Alerting FailuresSecurity events unlogged, secrets in logs, logs nobody alerts onLog authn/authz/admin events without sensitive data, alert on them, tamper-resistant storage
A10Mishandling of Exceptional ConditionsFail-open error paths, unhandled exceptions leaking state, half-applied transactionsFail closed, roll back atomically, generic errors outward, detail in internal logs
  • ASVS 5.0 (May 2025): requirement-level verification at levels 1-3. Use it when the user wants a verifiable checklist rather than a risk list.
  • API Security Top 10 (2023), for APIs: broken object-level and property-level authorization, unrestricted resource consumption, unrestricted access to sensitive business flows.
  • LLM Top 10 (2026 edition, published August 2026), for LLM features: prompt injection, excessive agency, improper output handling; treat model output as untrusted input. The ai-prompt-injection-defense skill holds the ID table; always write the edition with the ID (LLM03:2026).

Security review checklist

Authentication and authorization:

  • Password policy per NIST SP 800-63B-4 (length, breached-password check, no composition or rotation rules)
  • MFA available, phishing-resistant (passkeys/FIDO2) for admins
  • Session timeout implemented
  • Authorization checks on every endpoint
  • Role-based access control (RBAC)
  • Principle of least privilege

Input validation:

  • All input validated on allowlist
  • Input length limits enforced
  • Special characters handled
  • File upload validation
  • Content-Type validation

Data protection:

  • Sensitive data encrypted at rest
  • TLS for data in transit
  • Secrets in secure storage (not code)
  • PII handling compliant
  • Data minimization

Security headers:

  • Content-Security-Policy (frame-ancestors covers what X-Frame-Options did)
  • X-Content-Type-Options: nosniff
  • Strict-Transport-Security
  • Referrer-Policy
  • X-XSS-Protection omitted or set to 0 (deprecated; rely on CSP)

Error handling:

  • Generic error messages
  • No stack traces in production
  • Security events logged
  • No sensitive data in errors

Dependencies:

  • Dependency and secret scanning enabled in CI
  • Known vulnerabilities patched (CISA KEV entries first)
  • Lockfiles committed, CI actions pinned by SHA
  • Minimal dependencies, SBOM generated

Examples

Finished task, zero fluff: "Found 3 vulnerabilities. Remediation steps provided." Then stop. No explanations unless asked, and no duplicated findings.

Output format

Each finding: location, category (OWASP ID), the demonstrated flaw, and the fix. Don't create files (docs, Markdown reports) unless asked.

Checklist

  • Every reported vulnerability was demonstrated, not suspected.
  • Findings are not duplicated.
  • Multi-step remediation was confirmed with the user before execution, or the defaults listed when the user could not be asked.
  • Only the requested scope was touched.
  • Durable vulnerability patterns and remediation strategies were saved to memory after meaningful work, not transient state.

Composition / References

  • threat-modeling skill: design-level review before building.
  • ci-cd-pipelines skill: CI hardening for supply-chain findings.
  • ai-prompt-injection-defense skill: LLM Top 10 ID table.
  • secret-leak-response skill: when a secret has already been exposed.