Skip to content

fix: verify parent upgrades actually resolve the vulnerable package before recommending them#899

Merged
sonukapoor merged 8 commits into
mainfrom
fix/issue-896-verify-parent-upgrade
Jul 26, 2026
Merged

fix: verify parent upgrades actually resolve the vulnerable package before recommending them#899
sonukapoor merged 8 commits into
mainfrom
fix/issue-896-verify-parent-upgrade

Conversation

@sonukapoor

Copy link
Copy Markdown
Collaborator

The remediation resolver recommended a parent-dependency upgrade that did not actually resolve the vulnerable transitive package to a fixed version, and overstated it ("Running all commands above should fix all N findings"). Concrete case: it recommended jest@30.4.2 for a brace-expansion finding even though jest@30.4.2 still pulls the vulnerable brace-expansion via glob -> minimatch.

The deep-chain resolver now verifies along the dependency path: for each candidate parent version it walks the vulnerable path, resolving each declared range to its highest published version, and only recommends the upgrade (confidence verified) when the terminal package resolves to a fixed version or is dropped from the path. When no candidate resolves it, the resolver returns nothing instead of a false recommendation; when the path cannot be resolved, it falls back to an explicitly unverified suggestion. Unverified parent upgrades are marked in the terminal and HTML output and no longer count toward the "should fix all findings" claim.

Verified against the repo's own brace-expansion finding: the CLI no longer prints a false jest@30.4.2 fix, showing an honest advisory-hint-only result instead.

Closes #896

sonukapoor and others added 8 commits July 26, 2026 09:03
…commending them

Rewrite findUpgradeForImmediateIntermediate to three honest outcomes: walk the
vulnerable path through a candidate parent's declared dependency ranges and only
recommend (verified) when the terminal resolves to a fixed version or is dropped;
return null when no candidate resolves it; fall back to an explicitly unverified
heuristic only when the path cannot be resolved. Fixes the false parent-upgrade
recommendation from issue #896.

Refs #896
…fidence contamination

Two unrelated findings that recommend upgrading the same package merge into one
SuggestedFixTarget, so the blended target confidence must not decide coverage. A
direct (or verified) fix sharing a target package with an unrelated unverified
parent upgrade was wrongly dropped from coveredFindingCount. Coverage is now
evaluated from each finding's own recommendedParentUpgrade confidence.

Refs #896
…r brace-expansion

Adds a jest -> @jest/core -> minimatch -> brace-expansion regression where every
jest version still resolves brace-expansion below the fix, asserting the verified
resolver returns null instead of the old false jest@30.4.2 recommendation.

Refs #896
…ped-dep reason wording

Address final-review minor notes: add a comment that a 'verified' parent upgrade
is verified against declared ranges (not npm install-level dedup/hoisting), and
render a cleaner reason for the dropped-dependency case ('no longer pulls X on
this path') instead of the grammatically odd 'resolves X to not present, at or
above the fix'. Also fixes a stale 'best-effort' test comment.

Refs #896
@sonukapoor
sonukapoor merged commit c542e9c into main Jul 26, 2026
6 checks passed
@sonukapoor
sonukapoor deleted the fix/issue-896-verify-parent-upgrade branch July 26, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: remediation recommends an ineffective parent upgrade without verifying the child resolves to the fixed version

1 participant