package-lock.json vulnerability scanner
Paste or drop a package-lock.json and see every npm package with a known vulnerability, its severity, CVE and the version that fixes it. No install.
The file is read in your browser. Only package names and versions are sent to OSV when you scan.
This tool asks the OSV.dev vulnerability database directly from your browser. It sends the name, version and ecosystem of each package in the file, and then the IDs of the advisories that matched. The file itself, its paths, URLs and hashes stay in your browser, and nothing is sent to HardenKit.
How to use the package-lock.json vulnerability scanner
- Drop your package-lock.json on the page, or paste its contents.
- Check the number of packages on the button, then press it to ask OSV.dev.
- Read the table, worst first, and note the “Fixed in” version of each package.
- Upgrade with npm install package@version, or npm update for nested dependencies, and scan again.
About this tool
A package-lock.json records the exact version of every package npm installed, including the hundreds your own dependencies pulled in. That makes it the right file to check for known vulnerabilities: package.json only holds ranges, while the lockfile says what really runs. This scanner reads the file in your browser and asks OSV.dev, the open database that carries the GitHub Advisory Database, about each name and version.
It reads all three lockfile formats: the nested tree of lockfileVersion 1 (npm 5 and 6), and the flat “packages” map of versions 2 and 3 (npm 7 and later). Packages installed from git, a URL or a workspace folder have no registry version to look up, so they are listed as not checked instead of being passed over in silence.
Read the table from the top: it is sorted by the severity in each advisory, and “Fixed in” is the first version without the flaw on your release line. Severity is not the same as urgency. HardenKit Scan, our command-line scanner, adds what attackers are doing: it ranks findings by CISA KEV and EPSS and gives one upgrade per package.
Sources
Questions
It answers the same question from a different database. npm audit sends your dependency tree to the npm registry and gets GitHub advisories back. This scanner sends names and versions to OSV.dev, which includes the GitHub Advisory Database, and needs neither npm nor the project on your machine.
The file is parsed in your browser and is not uploaded. Only package names, versions and the ecosystem name “npm” are sent to OSV.dev. Names of private packages are part of that, so leave the file out if even the names are confidential.
Versions 1, 2 and 3, and npm-shrinkwrap.json, which has the same format. In a version 2 file the scanner reads the “packages” map, as npm 7 and later do, and ignores the older “dependencies” tree kept for compatibility.
Most entries in a lockfile are transitive: dependencies of your dependencies. They run in your application all the same. Use npm ls package-name to see which of your direct dependencies brings it in, and upgrade that one if the nested package cannot be updated alone.