---
name: dependency-vulnerability-triage
description: Sorts npm, pip or other audit output by whether the vulnerable code is reachable, then fixes the real risks first and documents what is safe to defer.
---

# Dependency vulnerability triage

Rank by reachability and exposure, not by headline severity.

## Steps

1. Run the ecosystem's audit with JSON output (`npm audit --json`, `pip-audit -f json`, `cargo audit --json`, `bundler-audit`). Keep the raw file.
2. Group findings by package. For each, note: advisory id, affected range, fixed version, and whether it is a direct or transitive dependency (`npm ls <pkg>` or `pipdeptree -r -p <pkg>`).
3. Decide reachability. Read the advisory to learn the vulnerable function or condition, then search the code for calls into it. Classify: reachable, possibly reachable, not reachable, dev or build only.
4. Weigh exposure: does attacker-controlled input get to it? Does it run in production or only in tests?
5. Order the fixes: reachable and internet-facing first, then possibly reachable, then the rest. Prefer the smallest bump that reaches the fixed version, using overrides or resolutions for transitive packages.
6. Apply one group of upgrades at a time, run the tests and build, and commit each separately so a break is easy to bisect.
7. For anything deferred, write the reason and a review date.

## Rules

- Do not run a blanket `npm audit fix --force`.
- Never ignore a finding without a written reason.
- If no fixed version exists, propose a mitigation or a replacement package.

## Report

A table: package, advisory, reachable (yes/no/unknown), action, status. Then the deferred list with reasons.
