Skip to content

fix(remediation): withhold cross-wired suggested fix targets - #1101

Closed
Ayush7614 wants to merge 1 commit into
OWASP:mainfrom
Ayush7614:fix/suggested-fix-crosswire-1007
Closed

fix(remediation): withhold cross-wired suggested fix targets#1101
Ayush7614 wants to merge 1 commit into
OWASP:mainfrom
Ayush7614:fix/suggested-fix-crosswire-1007

Conversation

@Ayush7614

Copy link
Copy Markdown
Collaborator

Refs #1007.

Summary

suggestedFixCommands could emit axios@4.0.6 — a version that never existed for axios and belongs to form-data in the same scan. The emitted npm install axios@4.0.6 fails outright and misreads as a 3-major breaking upgrade when the real fix is an in-major patch (axios@1.19.0).

Changes

  • New isSuspectCrossWiredTarget() guard in src/remediation/fix-commands.ts: a direct target that jumps 2+ majors AND exactly matches another package's installed/fixed version in the same scan is withheld with an actionable skipped reason instead of emitted.
  • Hardened upsertTarget(): same-package findings that disagree on target major keep the conservative (lower-major) target, so one divergent finding cannot hijack the merged target.
  • Exported majorOf() helper for reuse and testing.

Verification

  • New tests/fix-commands-crosswire.test.ts: 6 tests pass (detector unit tests + end-to-end plan regression reproducing the axios/form-data/js-yaml scan from the issue).
  • npm run build passes; existing classifier/fix-command tests unaffected.

Refs OWASP#1007.

suggestedFixCommands could emit axios@4.0.6 - a version that never existed
for axios and belongs to form-data in the same scan - producing an install
command that fails outright and misreads as a 3-major breaking upgrade.

Guard direct targets: when a target jumps 2+ majors AND exactly matches
another package's installed/fixed version in the same scan, withhold it
with an actionable skipped reason instead of emitting it. Also harden
upsertTarget so one divergent-major finding cannot hijack the merged
same-package target away from the conservative major line.
@Ayush7614 Ayush7614 closed this Sep 8, 2026
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.

1 participant