Skip to content

mk:vulnerability-scanner

Advanced vulnerability analysis principles. OWASP Top 10 baseline + current threat landscape awareness, supply chain security, attack surface mapping, and risk prioritization. Use when performing security audits, threat modeling, or OWASP reviews. NOT for STRIDE/CSO-mode infrastructure audits (see mk:cso).

What This Skill Does

  • Maps attack surface: entry points, data flows, trust boundaries, assets
  • Scans for OWASP Top 10 vulnerabilities adapted for contemporary threat landscape (AI/LLM risks, supply-chain attacks)
  • Audits dependency supply chain: known CVEs, typosquatting, install scripts, lockfile integrity
  • Searches code for high-risk patterns: SQL injection, dynamic code execution, unsafe deserialization, path traversal, disabled security
  • Detects exposed secrets: API keys, tokens, credentials, cloud provider prefixes
  • Prioritizes risks using EPSS (exploitability) and CVSS scoring
  • Produces structured findings: What, Where, Why, Impact, How to fix

When to Use

  • Security audit of a project or module
  • Before shipping code that handles auth, payments, or user data
  • When asked to "scan for vulnerabilities", "security check", "audit security"
  • When mk:cso delegates specific scanning tasks

NOT for: STRIDE/CSO-mode infrastructure audits (use mk:cso), diff-scoped PR security review (use mk:review).

Core Capabilities

Core Principles

PrincipleApplication
Assume BreachDesign as if attacker already inside
Zero TrustNever trust, always verify
Defense in DepthMultiple layers, no single point
Least PrivilegeMinimum required access only
Fail SecureOn error, deny access

4-Phase Process

1. RECONNAISSANCE -> Technology stack, entry points, data flows
2. DISCOVERY -> Configuration review, dependency analysis, code pattern search
3. ANALYSIS -> False positive elimination, risk scoring, attack chain mapping
4. REPORTING -> Clear reproduction steps, business impact, remediation guidance

OWASP Top 10 (2021 ranking, 2025 threat context)

RankCategoryThink About
A01Broken Access ControlIDOR, SSRF, who can access what?
A02Security MisconfigurationDefaults, headers, exposed services
A03Software Supply ChainDependencies, CI/CD, build integrity
A04Cryptographic FailuresWeak crypto, exposed secrets
A05InjectionUser input -> system commands
A06Insecure DesignFlawed architecture
A07Authentication FailuresSession, credential management
A08Integrity FailuresUnsigned updates, tampered data
A09Logging & AlertingBlind spots, no monitoring
A10Exceptional ConditionsError handling, fail-open states

Supply Chain Security (A03)

VectorRiskCheck
DependenciesMalicious packagesAudit new deps?
Lock filesIntegrity attacksCommitted?
Build pipelineCI/CD compromiseWho can modify?
RegistryTyposquattingVerified sources?

Code Pattern Analysis -- High-Risk Patterns

PatternRiskLook For
String concat in queriesInjection"SELECT * FROM " + input
Dynamic code executionRCEeval(), exec(), Function()
Unsafe deserializationRCEpickle.loads(), unserialize()
Path manipulationTraversalUser input in file paths
Disabled securityVariousverify=False, --insecure

Secret Patterns

TypeIndicators
API Keysapi_key, apikey, high entropy
Tokenstoken, bearer, jwt
Credentialspassword, secret, key
CloudAWS_, AZURE_, GCP_ prefixes

Risk Prioritization

Is it actively exploited (EPSS >0.5)?
|-- YES -> CRITICAL: Immediate action
|-- NO -> Check CVSS
         |-- CVSS >=9.0 -> HIGH
         |-- CVSS 7.0-8.9 -> Consider asset value
         |-- CVSS <7.0 -> Schedule for later

Exceptional Conditions (A10)

ScenarioFail-Open (BAD)Fail-Closed (GOOD)
Auth errorAllow accessDeny access
Parsing failsAccept inputReject input
TimeoutRetry foreverLimit + abort

Cloud Security Checklist

  • IAM: Least privilege?
  • Storage: Public buckets?
  • Network: Security groups?
  • Secrets: Using manager?

Threat Modeling Questions

Before scanning, ask: What are we protecting? Who would attack? How? What's the impact?

Arguments

No positional arguments. Invoked by name:

/mk:vulnerability-scanner

Workflow

  1. Map attack surface -- entry points, data flows, trust boundaries, assets
  2. Load scanning methodology -- read references/scanning-methodology.md
  3. Reconnaissance -- understand technology stack, entry points, data flows
  4. Discovery -- configuration review, dependency analysis, code pattern search
  5. Analysis -- validate findings, eliminate false positives, score risks
  6. Report -- each finding: What, Where, Why, Impact, How to fix

Usage

bash
# Scan current project for vulnerabilities
/mk:vulnerability-scanner

# The skill loads scanning-methodology.md and runs through the 4-phase process

Runtime Scripts

ScriptPurposeUsage
security-scan.pySecurity pattern scanning.claude/skills/.venv/bin/python3 .claude/scripts/security-scan.py
injection-audit.pyPrompt injection detection.claude/skills/.venv/bin/python3 .claude/scripts/injection-audit.py

Common Use Cases

  • Pre-release vulnerability scan for a module handling payments or user data
  • Dependency supply chain audit before deploying to production
  • Code pattern search for injection vulnerabilities in a new feature
  • Secret detection scan across the full codebase after a team member accidentally committed a key
  • Risk-scored OWASP assessment as part of a compliance checklist

Example Prompt

/mk:vulnerability-scanner We're about to launch the payment processing module. Run a full OWASP Top 10 scan — check for SQL injection, exposed secrets, dependency CVEs, and supply chain risks. Score every finding with CVSS so we know what to fix first.

Pro Tips

  • False positives in test fixtures: security scan flags intentionally insecure test data. Exclude test/fixtures/ and **/mocks/ from vulnerability scans.
  • Dependency confusion attacks missed: scanner checks known CVEs but not package name typosquatting. Cross-reference package names against known typosquat databases.
  • Not all CVEs are exploitable -- check if the vulnerable function is actually imported and called in your codebase.
  • Cloud secrets detection needs special attention: AWS_, AZURE_, GCP_ prefixes in config files or environment dumps.
  • This skill delegates to scanning scripts -- security-scan.py for pattern scanning, injection-audit.py for prompt injection detection.
  • For STRIDE threat modeling and full CSO audits, use mk:cso instead -- this skill handles focused OWASP/code-pattern scanning.

Released under the MIT License.