Dependency Vulnerability Triager
When to invoke
- "Triage today's
npm auditoutput." - "I have 87 CVEs from pip-audit — what should I actually fix this week?"
- "Group these advisories by package and tell me the upgrade path."
Inputs needed
- Scanner JSON from one of:
npm audit --jsonpip-audit --format json- OSV-Scanner JSON
- A generic list (the tool auto-detects)
- (optional) Reachability hints — a text file listing import paths your app actually uses (one per line). Findings whose package isn't reachable get demoted.
- (optional) Production-only flag — drop dev-dependency findings.
Workflow
- Detect the input format and normalize to a common record:
{id, package, installed, severity, cvss, fix_version, dev_only, summary}. - Deduplicate advisories that share
(package, id). - Score each finding:
- severity weight (critical=10, high=7, medium=4, low=1, none=0)
- +3 if a fix version exists (easy win)
- +2 if package appears in the reachability list
- −5 if dev-only and
--prod-onlyis set
- Group findings by package and pick the highest required fix version per package — one upgrade often resolves multiple CVEs.
- Output a ranked Markdown action list and a JSON file for tooling.
Output format
## P0 — fix this week
- <package> <installed> → <fix> (resolves N CVEs, max severity X)
## P1 — fix this sprint
## P2 — backlog
## Skipped (dev-only / no fix available)
Guardrails
- Never claim a CVE is "not exploitable" without an explicit reachability signal — the heuristic only demotes, it does not skip.
- Always show the highest CVSS in a group, not an average.
- If
fix_versionis missing, say so — do not invent versions.
Reference code
triage.py reads scanner JSON, normalizes, scores, groups, and writes Markdown + JSON output. Stdlib only.