bumblebee icon indicating copy to clipboard operation
bumblebee copied to clipboard

Case-insensitive npm name matching causes false positives against OSSF advisories for legacy mixed-case packages

Open philmcneal opened this issue 2 weeks ago • 0 comments

Version: main @ c1e83c0 (built from source)

What happened A catalog built with tools/osvcatalog from ossf/malicious-packages flags [email protected] as critical, matching MAL-2025-28475.

That advisory is for Orchestrator (capital O). It is a different legacy npm package. Today it is only the 0.0.1-security placeholder owned by npm (npm/security-holder). The lowercase orchestrator is robrich's package. Version 0.3.8 was published on 2016-11-05 and is a dependency of gulp 3. npm treats these legacy mixed-case names as separate packages. Orchestrator never published 0.3.8.

Finding evidence: exact name match, catalog entry matches any version (version=0.3.8), source_type npm-lockfile. Any project with an old gulp 3 toolchain in its lockfile gets this hit. We saw 35 of them on one laptop, all from copies of a WordPress theme's package-lock.json.

Reproduce

{"lockfileVersion": 1, "dependencies": {"orchestrator": {"version": "0.3.8"}}}

Scan a folder that contains only this package-lock.json, using a catalog built from current ossf/malicious-packages.

Scale The current ossf/malicious-packages npm tree has 103 advisories whose package name contains capitals, for example AdultJS, AlertLogic and AVNjs. Each one can collide with an unrelated lowercase package. Most of these advisories use introduced: "0", which matches any version, so every version of the lowercase package gets flagged.

Suggestion For the npm ecosystem, keep the advisory's original case through osvcatalog and compare names case-sensitively. At minimum, require an exact-case match when the advisory name is not all lowercase. PyPI should keep its PEP 503 normalization.

Workaround we use A post-filter dismisses an npm hit only when all of these are true:

  • The advisory name has capitals.
  • The advisory lists no lowercase name.
  • The evidence file contains the lowercase name but never the exact-case advisory name as a token.

If the file can't be read, the hit is kept.

philmcneal avatar Nov 18 '26 03:11 philmcneal