Skip to content

npm lockfile: CDN-resolved SheetJS releases are reported against npm-registry ranges #3073

Description

@j-del-fel

Problem

OSV-Scanner reports GHSA-4r6h-8v6p-xvw6 and GHSA-5pgg-2g8v-p4x9 for SheetJS CE 0.20.3 when an npm lockfile resolves the package directly from the official SheetJS CDN rather than the npm registry:

{
  "node_modules/xlsx": {
    "version": "0.20.3",
    "resolved": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
    "integrity": "sha512-oLDq3jw7AcLqKWH2AhCpVTZl8mf6X2YReP+Neh0SJUzV/BdZYjth94tG5toiMB1PPrYtxOCfaoUCkvtuH+3AJA=="
  }
}

The emitted OSV ranges contain only introduced: 0, so 0.20.3 is reported as affected. The source GHSA records carry database_specific.last_known_affected_version_range values of < 0.19.3 and < 0.20.2, respectively.

Primary evidence

This exact upstream-data problem was raised in google/osv.dev#4313. An OSV maintainer explained that the records are for the npm registry and that scanners “shouldn't be querying the npm ecosystem for non-npm-registry packages”: google/osv.dev#4313 (comment). A proposed GHSA fixed event was rejected because 0.20.2 was not published to npm: github/advisory-database#6477 (comment).

Requested behavior

When parsing npm/yarn lockfiles, please distinguish a package resolved from a non-registry tarball URL from the npm-registry package before querying the npm ecosystem, or otherwise avoid classifying versions outside the source advisory's last-known-affected range as vulnerable. This is similar in principle to the source-aware work discussed in #2850, but this case uses an HTTPS tarball rather than a git commit.

I am not requesting suppression or a change to raw result counts. I am asking for source-aware matching so the scanner does not apply npm-registry-only range semantics to verified vendor-CDN bytes.

Please let me know if a smaller lockfile reproducer or scanner version/output is needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions