/claude-skills-security:vuln-assessmentfrom claude-skills-security
End-to-end vulnerability assessment pipeline that produces a professional PDF security report for any codebase. Use this skill whenever the user wants a security audit, vulnerability assessment, security report, wants to find vulnerabilities, needs a pentest-style code review, or asks for threat modeling. Trigger on phrases like: "security audit", "vulnerability assessment", "vuln report", "find vulnerabilities", "security scan", "audit this codebase", "security review", "what are the security issues", "run a security analysis", "check for vulnerabilities", "pentest prep", "threat model this", "OWASP audit", "CWE scan". Even if the user just says "check this code for issues" or "is this code secure?" — use this skill. It orchestrates deep architectural context building, ultra-granular function analysis, systematic OWASP/CWE/cloud vulnerability hunting, CVE research enrichment, and professional PDF report generation in one end-to-end pipeline.
Ships in claude-skills-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A professional PDF vulnerability assessment report (dark navy theme, severity-coded finding cards, CVSS scores, code evidence, remediation guidance, prioritized roadmap) — the same quality as a manual pentest report, generated from a 6-phase pipeline.
Output: <ProjectName>_Vulnerability_Report.pdf saved in the target directory.
Before starting, collect the minimum required information:
If not already specified, ask:
"Which directory should I audit? (default: current working directory)"
Check if the target is a git repository:
git -C <target_path> rev-parse --is-inside-work-tree 2>/dev/null
If yes, list available branches and ask:
git -C <target_path> branch -a --format='%(refname:short)'
Then ask the user:
"This is a git repository. Which branch(es) would you like to audit?
Available branches:
main(current)developfeature/auth-refactor- ...
Options:
- Single branch: Enter a branch name (or press Enter to use current)
- Multiple branches: Comma-separate names to get one report per branch
- Comparison: Two branches to highlight new vulnerabilities introduced
If the user picks multiple branches or comparison mode, run the full 6-phase pipeline
independently for each branch (using git worktrees — see Branch Checkout below)
and generate a separate PDF per branch. Name them:
<ProjectName>_<BranchName>_Vulnerability_Report.pdf
After asking about the watermark, ask:
"Beyond the PDF, would you also like any of these machine-readable exports?
- CSV — flat spreadsheet with all findings; import directly into Excel, Jira, or any SIEM
- OCSF JSON — Open Cybersecurity Schema Framework v1.2.0 (class 2002 — Vulnerability Finding); native ingestion format for AWS Security Lake, Splunk, Chronicle, Elastic Security, and Microsoft Sentinel
Reply with one or more:
CSV,OCSF,both, or press Enter to skip."
Save the user's answer and pass the appropriate flags to the report generator in Phase 6. If the user selects OCSF, note that it produces a standards-compliant bundle containing one event per finding, including CVSS vectors, CWE references, affected resource identifiers, remediation guidance, and full OCSF envelope metadata — ready for SOC ingestion with no post-processing required.
Ask after question 5:
"Would you also like a Developer Remediation Guide PDF alongside the security report?
This is an engineer-facing document with root-cause pattern analysis, before/after code fixes, sprint roadmap, and file-by-file remediation instructions — written for developers, not security analysts.
Reply
yesor press Enter to skip."
Save the answer. If yes, Phase 7 will run after the PDF report is complete.
To analyze a branch without disturbing the working tree, use git worktree:
git -C <target_path> worktree add /tmp/vuln-assess-<branch> <branch>
Analyze from /tmp/vuln-assess-<branch> instead of the original path.
After analysis is complete, clean up:
git -C <target_path> worktree remove /tmp/vuln-assess-<branch> --force
If worktree creation fails (e.g. branch has an unclean name), fall back to:
git -C <target_path> stash
git -C <target_path> checkout <branch>
# ... analyze ...
git -C <target_path> checkout -
git -C <target_path> stash pop
Before starting the pipeline, tell the user:
"Starting vulnerability assessment for
<path>on branch<branch>.Phase 1 — Project Discovery Phase 2 — Architectural Context Building Phase 3 — Ultra-Granular Function Analysis Phase 4 — Vulnerability Hunting (checklist sections A–V) Phase 5 — CVE & Reference Research Enrichment Phase 6 — PDF Report Generation (if requested) Phase 7 — Developer Remediation Guide PDF
I'll update you after each phase completes."
Auto-detect project shape before any deep analysis:
pyproject.toml/package.json
name field, or git remote get-url origin (use repo name, strip .git).tests/, migrations/,
vendor/, node_modules/, dist/, .git/ unless they contain security-relevant code.Produce a scope summary before Phase 2:
Project: MyService
Language: Python 3.12 / FastAPI
Branch: main
Entry Points: src/main.py, src/worker.py
Data Stores: PostgreSQL, Redis, S3
External: SQS, Stripe API, Auth0
Scope: src/ (~4,200 lines) · Excluding: tests/, migrations/
If the codebase is very large (>15k lines in scope), ask the user whether to do a full audit or focus on specific high-risk modules.
If the user specifies a narrower scope — a particular file, module, or vulnerability class — honour it:
File/module scope: Restrict Phase 1 discovery and Phase 3 function analysis to the named
paths. In Phase 4, still work through all checklist categories, but only flag findings whose
evidence lives in the named paths. State the restriction clearly in the scope summary:
Scope: src/auth/ only — user-specified
Vulnerability class scope (e.g. "check for XSS only", "focus on auth issues"):
In Phase 4, explicitly work only the relevant checklist sections (e.g. for XSS → sections L, V).
Skip other sections but note the restriction: Checklist: sections L, V only (user-specified).
Phase 3 function analysis should still be done — it almost always surfaces the relevant class
more precisely than grep alone.
Combined scope: Apply both restrictions together.
In all narrowed cases, note the restriction in the PDF's scope table and executive summary so the reader understands this is a partial, not exhaustive, audit.
⚠️ Tool selection — common mistake:
audit-context-building:audit-contextis a Skill, NOT an Agent. Invoking it via the Agent tool will fail with "Agent type not found". Use only the Skill tool:skill: "audit-context-building:audit-context". (Note:audit-context-building:function-analyzerin Phase 3 IS an Agent — different tool.)
Use the Skill tool to invoke audit-context-building:audit-context.
Its job is pure understanding — no bug-hunting yet. Let it do a full pass.
If the skill is unavailable (not installed), perform this analysis inline by reading the key source files identified in Phase 1 and building the context yourself.
What to extract and retain from Phase 2 (you will use this in Phases 3–4):
Save this as _audit_context.md in the target directory and note the path.
Why this phase matters: Skipping to hunting without understanding the system produces a shallow list of grep-matches. Understanding the architecture first means you find the real issues — the ones that live at interaction boundaries and in assumptions that span multiple functions.
With the architectural map from Phase 2, identify the 20 highest-risk functions:
Priority criteria (rank by how many of these apply):
For each priority function, use the Agent tool with
subagent_type: "audit-context-building:function-analyzer" if that agent type is available.
If unavailable, perform the analysis inline using the same framework:
Document per-function findings in a scratch list — these become evidence for Phase 4.
Read references/vuln_checklist.md. Work through all 22 sections systematically.
The checklist covers:
For each category, check whether the codebase has that class of issue based on
your Phase 2–3 understanding. Mark categories as present / not present / N/A —
every category must be considered, not just the ones with obvious grep matches.
Before working through checklist sections, initialize the findings file:
Create _vuln_findings.json in the target directory with an empty findings array:
{"findings": []}
For every confirmed finding, immediately write it to _vuln_findings.json (append to
the findings array using the Write tool), then show a single compact status line:
✓ VUL-001 CRITICAL SQL Injection in login() app.py:35 → written
Do not reproduce the full finding card as conversation text — the JSON is the canonical record. All detail lives there; Phase 5 and Phase 6 read from it directly.
Each finding must include all fields when written:
{
"id": "VUL-NNN",
"severity": "CRITICAL",
"cvss": "9.8",
"cvss_vector": "AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"title": "Specific, actionable title — not generic",
"location": "file.py:line_range",
"description": "What the vulnerability is, why it exists, what makes it exploitable.",
"impact": "Concrete attacker outcome — not 'could lead to data exposure'",
"evidence": "Exact code snippet (4–15 lines) from the actual codebase.",
"remediation": "Specific, actionable fix with correct code pattern as example.",
"references": ""
}
The references field is left empty here and populated by Phase 5.
Severity and title guidance (unchanged — quality must not regress):
"SQL Injection". Good: "Pervasive SQL Injection via Untrusted Queue Message Fields""Could lead to data exposure". Good: "Full database read/write; cross-tenant data exfiltration possible"references/cvss_guide.mdSeverity calibration:
After the first pass, do a chained-attack second pass. Individual findings are one thing, but real attacks chain vulnerabilities together. Actively look for these combinations:
redirect_uri endpoint
can be used to redirect authorization codes or access tokens to an attacker's server.169.254.169.254 gives
the attacker IAM role credentials, which then allows reading secrets, S3 buckets, or further
lateral movement — escalate the SSRF's severity accordingly.random (not secrets) is used
for session/reset tokens AND there's no rate limiting on the validation endpoint, the weakness
is exploitable, not just theoretical.For each chain you find, create a separate finding (or upgrade an existing finding's severity) that explains the full attack path from initial access to final impact.
Before invoking any skill, check whether the API keys are configured:
bash -c '[ -n "$PARALLEL_API_KEY" ] || [ -n "$OPENROUTER_API_KEY" ] && echo "available" || echo "unavailable"'
claude-scientific-writer:research-lookup
for every CRITICAL and HIGH finding (and optionally MEDIUM).Tasks for each finding (via skill or built-in knowledge):
For each enriched finding, update its references field directly in _vuln_findings.json
using the Write tool (read → patch → write). Do not reproduce finding text in conversation.
Show a compact status line per finding:
✓ VUL-001 references updated → CWE-89 · OWASP A03:2021 · CVE-2023-XXXXX
Never guess CVE numbers — if uncertain, write CWE-XXX · OWASP A0X:2021 only.
_vuln_findings.json with project metadataAll findings were written to _vuln_findings.json incrementally during Phase 4 and
enriched with references during Phase 5. Step 1 adds the top-level metadata fields
by reading the file and prepending the project envelope:
{
"project_name": "<project name>",
"target_path": "<absolute path>",
"branch": "<branch name or 'N/A'>",
"language": "<primary language and version>",
"framework": "<framework or 'None'>",
"assessment_type": "Static Code Review + Architecture Audit",
"report_date": "<YYYY-MM-DD>",
"scope_rows": [
["Module", "Path", "Lines (approx)"],
["<module name>", "<path>", "<line count>"]
],
"data_flow_summary": "<2–3 sentence description of the main data flow>",
"external_deps": [
["Store", "Library", "Usage", "Auth Method"],
["PostgreSQL", "psycopg2", "Primary data store", "Env credentials"]
],
"findings": [ ... ]
}
Read the existing findings array from the file, wrap it with the metadata envelope
above, and write the complete structure back. Do not overwrite or re-derive findings
— use exactly what was written during Phase 4/5.
Note: branch is a top-level field — the generator will show it in the cover
page meta block if present.
After writing findings, also populate these fields in _vuln_findings.json:
methodology — From Phase 4 checklist pass:
"methodology": {
"framework": "OWASP WSTG v4.2 · CWE Top 25 · NIST SP 800-115",
"type": "White-Box Static Analysis + Architecture Review",
"coverage": [
{"category": "A01:2021 — Broken Access Control", "status": "tested", "findings": 2},
{"category": "A02:2021 — Cryptographic Failures", "status": "tested", "findings": 0},
{"category": "A03:2021 — Injection", "status": "tested", "findings": 1}
]
}
Status values: "tested" | "partial" | "na". Count actual findings per category.
threat_model — From Phase 2 architecture context:
"threat_model": {
"assets": [
["Asset", "Classification", "Risk if Compromised"],
["User credentials", "Critical", "Account takeover"]
],
"threat_actors": [
["Actor", "Motivation", "Capability", "Attack Vector"],
["External attacker", "Data theft", "High", "Public API"]
],
"attack_surface": [
["Entry Point", "Method", "Auth Required", "Related Findings"],
["POST /login", "HTTP API", "None", "VUL-013"]
],
"trust_boundaries": [
"Browser → API Server (HTTPS + cookie)",
"API Server → Database (internal network)"
]
}
attack_chains — From Phase 4 chained-attack second pass:
"attack_chains": [
{
"id": "CHAIN-001",
"title": "XSS → Session Theft → Privilege Escalation",
"severity": "CRITICAL",
"prerequisites": "Attacker can inject a WebSocket notification",
"impact": "Full admin account takeover",
"steps": [
{"step": 1, "finding_id": "VUL-003", "action": "Inject XSS via notification", "outcome": "Script executes in victim browser"},
{"step": 2, "finding_id": "VUL-007", "action": "Steal session from localStorage", "outcome": "Valid session obtained"},
{"step": 3, "finding_id": "VUL-004", "action": "Forge User Policy object", "outcome": "Admin privileges gained"}
]
}
]
security_strengths — From Phase 2 positive observations:
"security_strengths": [
{
"title": "HTTP-Only Cookie Session Management",
"description": "Sessions use HTTP-only cookies with withCredentials: true, preventing JS-based token theft."
}
]
These fields are optional — if absent, the corresponding sections show a placeholder note.
Find the generate_report_html.py script:
find ~/.claude/skills -name "generate_report_html.py" 2>/dev/null | head -1
Run it (replace <skill_scripts_dir> with the path from above):
python <skill_scripts_dir>/generate_report_html.py \
--findings _vuln_findings.json \
--output "<ProjectName>_Vulnerability_Report.pdf" \
[--csv "<ProjectName>_Vulnerability_Report.csv"] \
[--ocsf "<ProjectName>_Vulnerability_Report.ocsf.json"]
--csv only if the user requested CSV export in Step 0.--ocsf only if the user requested OCSF export in Step 0.The --csv flag produces a flat CSV (ID, Severity, CVSS, Title, Location, Sprint, Description,
Impact, Evidence, Remediation) importable into Excel, Jira, or any SIEM.
The --ocsf flag produces an OCSF v1.2.0 Vulnerability Finding bundle (class_uid 2002) with one
event per finding, including full CVSS vectors, CWE references, OWASP mappings, affected resource
identifiers, and remediation guidance — ready for native ingestion into AWS Security Lake, Splunk,
Chronicle, Elastic Security, or Microsoft Sentinel with no post-processing required.
The script generates a styled HTML report and renders it to PDF using Chrome headless. No external Python dependencies required — only Google Chrome or Chromium must be installed.
If Chrome is not found, the script will print the HTML path so you can open it manually in Chrome and use Ctrl+P → Save as PDF.
Design: Space Grotesk / Space Mono / Syne fonts · dark navy cover grid · severity-coded finding cards (CRITICAL=red, HIGH=orange, MEDIUM=amber, LOW=green) · fixed header/footer on every page · sprint kanban roadmap · full A4 layout with 18mm breathing room below header.
Tell the user:
"Report generated →
<ProjectName>_Vulnerability_Report.pdfN findings: X critical · Y high · Z medium · W low(if CSV was requested) CSV export →
<ProjectName>_Vulnerability_Report.csv(if OCSF was requested) OCSF v1.2.0 JSON →<ProjectName>_Vulnerability_Report.ocsf.json→ Ingest directly into AWS Security Lake, Splunk, Chronicle, Elastic Security, or Microsoft Sentinel."
Then save a concise audit context to memory (memory/MEMORY.md or a dedicated
memory/audit_<ProjectName>.md). Use this exact format so future sessions can
instantly pick up the context:
## Security Audit (<date>, branch: <branch>)
Report: <absolute path to PDF>
Findings JSON: <absolute path to _vuln_findings.json>
### Architecture Summary
- Stack: <language/framework>
- Auth: <auth mechanism summary>
- Data stores: <DB/cache/storage>
- Key invariants: <1–3 critical architectural facts to know>
### Findings Summary (<N> total: X CRITICAL · Y HIGH · Z MEDIUM · W LOW · V INFO)
| ID | Sev | Title | Location |
|----|-----|-------|----------|
| VUL-001 | HIGH | ... | file.py:42 |
...
Keep both _vuln_findings.json and _audit_context.md in the target directory — they
are durable artifacts. _vuln_findings.json is useful for re-running the report generator,
diffing findings across runs, and SOC ingestion. _audit_context.md contains the deep
architectural context (module map, data flows, trust boundaries, per-function analysis)
needed by downstream tooling — including Phase 7 if the developer guide was requested.
Run only if the user answered yes in Step 0 question 6.
This phase produces a developer-facing PDF using the claude-scientific-writer:scientific-writing
skill — the same pipeline that authored the validated vulnapp guide. All content comes from the
two durable artifacts already in the target directory; no research-lookup is needed.
Use the Skill tool to invoke claude-scientific-writer:scientific-writing with this prompt:
Write a high-quality developer security remediation guide for the <ProjectName> codebase.
Source files (both located at <target_path>):
- _audit_context.md — deep architectural context: module map, data flows,
trust boundaries, per-function analysis
- _vuln_findings.json — all findings with CVSS scores, evidence, and remediation
Skip the research-lookup step — all content is provided in those two files.
Audience: software developers and engineering leads, not security analysts.
Output: save the guide as <target_path>/<ProjectName>_Developer_Remediation_Guide.md
The guide must be written in flowing prose (no bullet-point body sections).
Structure:
For Engineering Leads: The One-Page Summary (callout box: TL;DR, sprint estimates)
1. How the Codebase Got Here: Understanding the Root Causes
(3–6 systemic anti-patterns from _audit_context.md that explain most findings)
2. What an Attacker Can Do Right Now (No Login Required)
(2–4 highest-severity zero-prerequisites attack paths with PoC one-liners)
3. File-by-File Remediation Instructions
(one subsection per file/finding cluster; BEFORE + AFTER code blocks; why it works)
4. Architectural Recommendations
(2–4 structural improvements; not sprint-required — context for later)
5. Sprint-Ready Remediation Roadmap
(Sprint 1: Critical, Sprint 2: High, Sprint 3: Medium/Low + deps; hours per sprint)
6. Verifying the Fixes
(one concrete test command per major fix type)
7. What Not to Change
(security_strengths from _vuln_findings.json — what to preserve)
Appendix A: Complete Finding Reference Index
(table: ID · Severity · CVSS · Title · File:Line)
First, try generate_guide_html.py (preferred — produces the styled navy/blue PDF matching the
report's visual identity):
GUIDE_SCRIPT="$(find /home -name generate_guide_html.py -path '*/vuln-assess/scripts/*' 2>/dev/null | head -1)"
if [ -n "$GUIDE_SCRIPT" ]; then
python "$GUIDE_SCRIPT" \
--guide "<target_path>/<ProjectName>_Developer_Remediation_Guide.md" \
--findings "<target_path>/_vuln_findings.json" \
--output "<target_path>/<ProjectName>_Developer_Remediation_Guide.pdf"
else
# Fallback: pandoc → DOCX → LibreOffice PDF
pandoc "<target_path>/<ProjectName>_Developer_Remediation_Guide.md" \
-o "<target_path>/<ProjectName>_Developer_Remediation_Guide.docx" \
--highlight-style=tango
soffice --headless --convert-to pdf \
--outdir "<target_path>" \
"<target_path>/<ProjectName>_Developer_Remediation_Guide.docx" 2>/dev/null
rm -f "<target_path>/<ProjectName>_Developer_Remediation_Guide.docx"
fi
Add to the final confirmation message:
Developer Remediation Guide →
<ProjectName>_Developer_Remediation_Guide.pdf(engineer-facing: root causes · before/after fixes · 3-sprint roadmap)
Before running the report generator, verify against _vuln_findings.json:
file.py:line locationevidence (not paraphrased)remediationreferences — CWE + OWASP if uncertainreferences fields are non-empty (populated by Phase 5)scripts/generate_report_html.py — HTML → Chrome-headless PDF generator. No pip dependencies.
CLI: python generate_report_html.py --findings <json> --output <pdf> [--watermark TEXT]
Visual design: Space Grotesk + Space Mono + Syne fonts (Google Fonts) · dark navy (#0D1117)
cover with 42/58 grid split · severity-coded finding cards (crit/high/med/low color system) ·
fixed 12mm header + 10mm footer on every page · 30mm top padding gives 18mm of breathing
room below the header on body pages · break-inside: avoid + padding-top trick ensures
cards never split across page breaks.
Report sections (8 sections, gold-standard industry structure):
Chrome detection order: google-chrome → google-chrome-stable → chromium → chromium-browser.
If none found, script prints the HTML path for manual print-to-PDF.
references/vuln_checklist.md — 18-section checklist covering:
OWASP Web Top 10 · OWASP API Security Top 10 (2023) · CWE Top 25 ·
XSS/CSRF/SSRF/XXE/Deserialization · JWT/OAuth2/GraphQL · Cloud (AWS/GCP/Azure) ·
Architecture · Supply Chain · ReDoS · HTTP Smuggling · Security Observability
references/cvss_guide.md — CVSS 3.1 base score quick-reference for consistent scoring.
assets/fonts/manifest.json (opens in a new tab)assets/fonts/space_grotesk_300_normal.woff2 (opens in a new tab)assets/fonts/space_grotesk_400_normal.woff2 (opens in a new tab)assets/fonts/space_grotesk_500_normal.woff2 (opens in a new tab)assets/fonts/space_grotesk_600_normal.woff2 (opens in a new tab)assets/fonts/space_grotesk_700_normal.woff2 (opens in a new tab)assets/fonts/space_mono_400_italic.woff2 (opens in a new tab)assets/fonts/space_mono_400_normal.woff2 (opens in a new tab)assets/fonts/space_mono_700_normal.ttf (opens in a new tab)assets/fonts/space_mono_700_normal.woff2 (opens in a new tab)assets/fonts/syne_400_normal.woff2 (opens in a new tab)assets/fonts/syne_600_normal.woff2 (opens in a new tab)assets/fonts/syne_700_normal.woff2 (opens in a new tab)assets/fonts/syne_800_normal.woff2 (opens in a new tab)evals/evals.json (opens in a new tab)evals/fixtures/layout_test/_vuln_findings.json (opens in a new tab)evals/run_layout_test.sh (opens in a new tab)references/cvss_guide.md (opens in a new tab)references/vuln_checklist.md (opens in a new tab)scripts/__pycache__/generate_report_html.cpython-312.pyc (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
Other plugins' skills for the same job
Generated from the plugin's indexed repository (yashvendra/claude-security-skills) — no native marketplace selected
npx claudepluginhub p/yashvendra-claude-skills-security