Skip to content

skillSecurity

Dependency Vulnerability Triage

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.

npx workspacetemplates add dependency-vulnerability-triage --tool claude-code

Writes 1 file to .claude/skills/dependency-vulnerability-triage/

.claude/skills/dependency-vulnerability-triage/SKILL.md28 lines · 1.6 KBFile
---
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.

What it does

An audit with 63 findings usually hides three that matter. Bumping everything at once breaks builds and teaches people to ignore the report. This skill ranks the findings by exposure instead of by raw severity score.

For each advisory it checks whether your code reaches the affected function, whether the package is runtime or dev only, and what the smallest safe upgrade is. You end with an ordered plan and a short list of accepted risks with reasons.

Example

you › npm audit shows 41 vulnerabilities. Tell me what to fix first.

agent › 3 matter. 1) jsonwebtoken 8.5.1 is reachable in auth/verify.ts; bumped to 9.0.2, tests pass. 2) axios 0.21.1 SSRF is reachable through the proxy route; bumped to 1.7.x. 3) lodash 4.17.15 prototype pollution through merge in config.ts; bumped. 31 are dev-only (webpack-dev-server, jest tooling) and 7 are in code paths we never call. Deferred list with reasons is in docs/audit.md.

Questions

Is it safe to ignore dev-only findings?
Often, but not always. Build tools can run on CI with secrets, so it records them as deferred with a reason rather than dropping them.
What if it cannot tell whether a function is reachable?
It marks the finding as unknown and treats it as reachable until you decide otherwise.
  • CSRF and CORS Hardening

    SkillSecurity

    Free
  • JWT Security

    SkillSecurity

    Free