Skip to content

Look up OSV advisories under the npm package name - #626

Merged
eoftedal merged 1 commit into
RetireJS:masterfrom
arpitjain099:fix/osv-npm-name
Sep 21, 2026
Merged

eoftedal merged 1 commit into
RetireJS:masterfrom
arpitjain099:fix/osv-npm-name

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

With --includeOsv, scanner.ts hands checkOSV the repository's display key. That is the name used in reports, not the name on npm, and for 21 of the 26 components that declare an npmname the two differ: underscore.js against underscore, moment.js against moment, DOMPurify against dompurify, angularjs against angular. The deps.dev URL then 404s, loadJson turns that into undefined, and checkOSV returns an empty list without logging anything, so the run looks clean.

Calling the same exported function with each spelling:

underscore.js 1.8.0 -> 0 vulnerabilities
underscore    1.8.0 -> 2 vulnerabilities
moment.js     2.18.0 -> 0 vulnerabilities
moment        2.18.0 -> 5 vulnerabilities

reporters/utils.ts already resolves this as component.npmname || component.component, and the core sets npmname on every result, so the value is on the object the scanner is holding.

No test added: checking this needs a live deps.dev call, and there is no spec for that module. npm run check, build and the 62 specs are green.

checkOSV was given the repository's display key, which is the name shown in
reports rather than the name on npm. 21 of the 26 components that declare an
npmname differ, so the deps.dev request 404s, loadJson turns that into
undefined and checkOSV returns an empty list with nothing logged. The reporter
already resolves this the same way, with npmname falling back to component.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@eoftedal
eoftedal merged commit 6260a52 into RetireJS:master Sep 21, 2026
3 checks passed
@eoftedal

Copy link
Copy Markdown
Member

Thanks for this, @arpitjain099

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.

2 participants