Skip to content

Commit 1251ef7

Browse files
committed
docs: explain remediation target selection
1 parent 2a6cb42 commit 1251ef7

6 files changed

Lines changed: 342 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ No account. No configuration. No source code leaves your machine.
8282

8383
- **Produces copy-and-run fix commands** — every finding comes with a package-manager-aware install command you can run immediately
8484
- **Distinguishes direct from transitive risk** — shows whether the vulnerability is in something you installed or buried three levels deep in a dependency chain
85+
- **Explains parent update paths** — for transitive npm findings, recommends `npm update <parent>` when the current parent range can resolve a known non-vulnerable child, or a parent upgrade when the range itself must change
8586
- **Usage-aware reachability** — optionally uses static analysis to detect whether vulnerable packages are actually imported in your code, cutting noise with `--usage` and `--only-used`
8687
- **Offline advisory DB** — sync advisory data ahead of time and scan with zero runtime API calls, designed for enterprise and air-gapped environments
8788
- **Interactive HTML report** — generate a self-contained dashboard with severity cards, a searchable findings table, and copy-ready fix commands (`--report`)
@@ -157,12 +158,15 @@ For full CI patterns including offline workflows, git hooks, and scripted automa
157158
| Usage-aware reachability scanning | ✅ | ❌ | ❌ | ✅ | ⚠️ |
158159
| Direct vs transitive visibility | ✅ | ⚠️ | ✅ | ✅ | ✅ |
159160
| Copy-and-run fix commands | ✅ | ❌ | ❌ | ✅ | ⚠️ |
161+
| Transitive parent update guidance | ✅ | ❌ | ⚠️ | ⚠️ | ⚠️ |
160162
| Suggested remediation plan | ✅ | ❌ | ⚠️ | ✅ | ⚠️ |
161163
| JSON output | ✅ | ✅ | ✅ | ✅ | ✅ |
162164
| Offline/local advisory DB | ✅ | ❌ | ⚠️ | ❌ | ❌ |
163165

164166
<sub>✅ = built-in strength · ⚠️ = partial or workflow-dependent · ❌ = not a core strength</sub>
165167

168+
The transitive parent guidance is a key difference: CVE Lite CLI avoids recommending direct installs for packages that are only present transitively. For npm lockfiles, it can identify when `npm update <parent>` is enough to re-resolve a known non-vulnerable child within the current parent range, and when the parent package itself needs an upgrade.
169+
166170
For detailed per-tool analysis, see [Comparison with other tools](docs/comparison.md).
167171

168172
## Real-world validation
@@ -288,6 +292,8 @@ npx cve-lite-cli /path/to/project --fix
288292

289293
See the [Fix mode guide](docs/fix-mode.md) for output details and interpretation.
290294

295+
For a deeper explanation of how the CLI chooses direct upgrades, parent upgrades, and npm `update` recommendations for transitive findings, see the [Remediation Strategy guide](docs/remediation-strategy.md).
296+
291297
## HTML vulnerability report (`--report`)
292298

293299
Generate a self-contained HTML dashboard from any scan — severity cards, an interactive findings table with search, copy-ready fix commands, and breaking-change indicators on upgrades — all written to a local directory and opened automatically in your browser.
@@ -357,6 +363,8 @@ See [troubleshooting.md](docs/troubleshooting.md) for common issues: no lockfile
357363

358364
See [parser-coverage.md](docs/parser-coverage.md) for supported lockfile formats, selection priority, the `package.json` fallback, and known edge cases including monorepos and private registries.
359365

366+
See [remediation-strategy.md](docs/remediation-strategy.md) for how CVE Lite CLI chooses package upgrade targets and parent update paths.
367+
360368
## Contributing
361369

362370
Feedback on output clarity, remediation guidance, ecosystem coverage, and CI usage is especially valuable.

docs/comparison.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ CVE Lite CLI is not trying to be everything for everyone. It is designed to be o
2727
| Usage-aware reachability scanning |||||| ⚠️ |
2828
| Direct vs transitive visibility || ⚠️ | ⚠️ ||||
2929
| Validated copy-and-run fix commands |||||| ⚠️ |
30+
| Transitive parent update guidance ||| ⚠️ | ⚠️ | ⚠️ | ⚠️ |
3031
| Fix version validation before suggesting ||||| ⚠️ ||
3132
| Clear top-priority fix guidance |||||| ⚠️ |
3233
| Suggested remediation plan |||| ⚠️ || ⚠️ |
@@ -36,6 +37,8 @@ CVE Lite CLI is not trying to be everything for everyone. It is designed to be o
3637

3738
<sub>✅ = built-in strength · ⚠️ = partial or workflow-dependent · ❌ = not a core strength</sub>
3839

40+
Transitive parent update guidance is one of CVE Lite CLI's core differentiators. Instead of telling users to install a vulnerable transitive package directly, the CLI points at the parent package that controls the dependency path. For npm lockfiles, it can distinguish between `npm update <parent>` when the current parent range can absorb a known non-vulnerable child and `npm install <parent>@<version>` when the parent range itself must change.
41+
3942
---
4043

4144
## Offline support

docs/how-it-works.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CVE Lite CLI is a **local-first, metadata-only** scanner. It operates directly w
1111
- [Trust boundary and privacy](#trust-boundary-and-privacy)
1212
- [Lockfile-driven accuracy](#lockfile-driven-accuracy)
1313
- [Direct vs transitive triage](#direct-vs-transitive-triage)
14+
- [Remediation strategy](#remediation-strategy)
1415
- [Performance and caching](#performance-and-caching)
1516
- [Offline advisory flow](#offline-advisory-flow)
1617
- [Standards-based output](#standards-based-output)
@@ -46,6 +47,14 @@ This separation enables a "fix the root" strategy. Instead of chasing every nest
4647

4748
---
4849

50+
## Remediation strategy
51+
52+
CVE Lite CLI turns findings into package-manager-native commands when the available metadata supports a confident path. Direct findings use validated package upgrades. Transitive findings prefer the parent package that introduced the vulnerable dependency, including npm-specific `npm update <parent>` recommendations when a known non-vulnerable child version already fits within the current parent range.
53+
54+
See the [Remediation Strategy guide](remediation-strategy.md) for the full decision model and package-manager notes.
55+
56+
---
57+
4958
## Performance and caching
5059

5160
A local TTL cache stores advisory results. This ensures that subsequent scans — common in iterative development or CI/CD retry loops — are near-instant and respect external API rate limits.

docs/index.html

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<nav>
8181
<a href="#quick-start">Quick Start</a>
8282
<a href="#features">Features</a>
83+
<a href="#parent-aware">Parent-aware fixes</a>
8384
<a href="#fix-mode">Fix Mode</a>
8485
<a href="#workflow">Workflow</a>
8586
<a href="#speed">Speed</a>
@@ -130,6 +131,7 @@ <h1>Scan. Understand. Fix.</h1>
130131
<li>Usage-aware reachability scanning</li>
131132
<li>Offline scans with local advisory DB</li>
132133
<li>Copy-and-run direct fix commands</li>
134+
<li>Parent-aware transitive guidance</li>
133135
<li>Conservative auto-remediation with `--fix`</li>
134136
</ul>
135137
<div class="pillars">
@@ -272,6 +274,51 @@ <h3>Developer-first by default</h3>
272274
</div>
273275
</section>
274276

277+
<section class="container parent-aware-section" id="parent-aware">
278+
<div class="spotlight-card">
279+
<div>
280+
<p class="eyebrow">Parent-aware remediation</p>
281+
<h2>Fix the package that controls the vulnerable dependency path.</h2>
282+
<p>
283+
Transitive CVEs are easy to mis-handle. Installing the vulnerable child directly can change your manifest
284+
without changing the dependency path that introduced it. CVE Lite CLI points at the parent instead.
285+
</p>
286+
</div>
287+
<div class="command-compare">
288+
<div>
289+
<span class="compare-label muted-label">Avoid</span>
290+
<pre><code>npm install vulnerable-child@fixed</code></pre>
291+
</div>
292+
<div>
293+
<span class="compare-label">Prefer when range allows it</span>
294+
<pre><code>npm update parent-package</code></pre>
295+
</div>
296+
<div>
297+
<span class="compare-label">Or when the range must change</span>
298+
<pre><code>npm install parent-package@target</code></pre>
299+
</div>
300+
</div>
301+
</div>
302+
<div class="grid three">
303+
<article class="card">
304+
<h3>Understands npm parent ranges</h3>
305+
<p>For npm lockfiles, the CLI checks whether a known non-vulnerable child can be resolved inside the current
306+
parent range before recommending a parent upgrade.</p>
307+
</article>
308+
<article class="card">
309+
<h3>Works with workspace hoisting</h3>
310+
<p>Workspace-local package context is preserved, so hoisted npm packages can still be mapped back to their
311+
logical parent chain.</p>
312+
</article>
313+
<article class="card">
314+
<h3>Documents the decision model</h3>
315+
<p><a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/remediation-strategy.md">Read the
316+
remediation strategy</a> to see when the CLI recommends direct upgrades, parent updates, or parent
317+
upgrades.</p>
318+
</article>
319+
</div>
320+
</section>
321+
275322
<section class="container" id="workflow">
276323
<h2>Three Workflow Modes</h2>
277324
<div class="grid three">
@@ -326,6 +373,8 @@ <h3>Real-world case studies</h3>
326373
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/case-studies/nestjs.md">NestJS</a>
327374
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/case-studies/analog.md">Analog</a>
328375
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/fix-mode.md">Fix mode guide (--fix)</a>
376+
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/remediation-strategy.md">Remediation
377+
strategy</a>
329378
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/html-report.md">HTML report guide (--report)</a>
330379
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/how-to-read-verbose-output.md">How to
331380
read verbose output</a>
@@ -370,6 +419,8 @@ <h3>Guides and deep dives</h3>
370419
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/comparison.md">Comparison with other
371420
tools</a>
372421
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/how-it-works.md">How it works</a>
422+
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/remediation-strategy.md">Remediation
423+
strategy</a>
373424
<a href="https://github.com/OWASP/cve-lite-cli/blob/main/docs/roadmap.md">Roadmap</a>
374425
</p>
375426
</article>

0 commit comments

Comments
 (0)