Skip to content

fix: merge duplicate findings for the same package from multiple advisory sources - #1076

Merged
sonukapoor merged 3 commits into
mainfrom
feature/dedup-findings-by-source
Sep 5, 2026
Merged

fix: merge duplicate findings for the same package from multiple advisory sources#1076
sonukapoor merged 3 commits into
mainfrom
feature/dedup-findings-by-source

Conversation

@sonukapoor

Copy link
Copy Markdown
Collaborator

Fixes a bug where the same package could appear as two separate rows in all outputs (compact, verbose, HTML, JSON, SARIF) when both OSV and the npm supplemental advisory pass returned advisories for it with different IDs.

Adds a mergeResultsByPackage helper in src/scanner.ts that collapses the flat results array by name@version before findings are created, so all vuln IDs from both sources land in a single Finding. The dedup guard inside the helper also prevents double-counting if the same ID ever appears from both sources.

Also widens the Type column in the HTML report findings table so "direct · dev" badges have more breathing room.

Closes #1075

@sonukapoor
sonukapoor force-pushed the feature/dedup-findings-by-source branch from 89abb57 to 184336a Compare September 5, 2026 15:15
@sonukapoor
sonukapoor merged commit ebff07e into main Sep 5, 2026
6 checks passed
@sonukapoor
sonukapoor deleted the feature/dedup-findings-by-source branch September 5, 2026 15:17
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: same package appears as two rows when OSV and npm advisory both have findings for it

1 participant