Skip to content

fix: CVE data accuracy — no double counting, installed versions, NVD aliases - #10

Open
AjayBThorat-20 wants to merge 1 commit into
refactor/finding-model-and-collector-registryfrom
fix/cve-data-accuracy
Open

AjayBThorat-20 wants to merge 1 commit into
refactor/finding-model-and-collector-registryfrom
fix/cve-data-accuracy

Conversation

@AjayBThorat-20

@AjayBThorat-20 AjayBThorat-20 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

What and why

The vulnerability data was double-counting and mislabeling findings:

  • The same vulnerability was counted twice. An ecosystem alert of type vulnerability was filed as a quality finding, so it never merged with the CVE finding for that package and lowered the score twice. It's a security finding now, and merges.
  • Versions are always the installed ones, never an advisory's vulnerable range (qs@<=6.15.3) or unknown.
  • NVD enrichment practically never matched. OSV identifies npm advisories by GHSA id, but NVD only knows CVE ids; the CVE id now comes from the OSV record's aliases.
  • npm audit findings use the advisory title instead of a list of package names ("body-parser, qs").
  • Every advisory id survives the per-package merge; free-text ecosystem fixes no longer read "Update to Consider alternatives…".

On a project with minimist@1.2.5 and qs@6.7.0: duplicate findings drop from 7 to 6, qs keeps all 4 advisories, and no version is a range or unknown.

Stacked on #9.

Merging the stack: use Create a merge commit, not squash (squashing makes every later PR show these commits again). After merging the PR below this one, click Delete branch on it; GitHub then retargets this PR to main and CI runs.

How I tested it

🤖 Generated with Claude Code

…aliases

- An ecosystem alert of type "vulnerability" was filed as a quality finding,
  so it never merged with the CVE finding for the same package: the same
  vulnerability appeared twice and lowered the score twice. It is now a
  security finding and merges.
- Never use an advisory's vulnerable range as a finding's version; findings
  without a version get the installed one from node_modules.
- Query NVD with the CVE id from the OSV record's aliases (NVD doesn't know
  GHSA ids, so enrichment practically never matched); skip it when there is
  no CVE alias.
- Describe npm audit findings with the advisory title instead of the
  dependency-chain package names.
- Keep every advisory id from cve.collector's per-package merge.
- Don't prefix a free-text ecosystem fix with "Update to".

On a project with minimist@1.2.5 and qs@6.7.0, duplicate findings drop from
7 to 6, qs keeps all 4 advisories, and no version is a range or "unknown".
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