npm package vulnerability checker
Check any version of an npm package for known vulnerabilities without installing it. See each CVE, its severity and the version that fixes it.
As in package.json, with the scope if it has one: lodash, @babel/traverse.
One exact version, as in your lockfile. Not a range.
This tool asks the OSV API directly from your browser. It sends the npm package name and the version you check, and nothing is sent to HardenKit.
How to use the npm package vulnerability checker
- Enter the package name, with its scope if it has one.
- Enter the exact version from package-lock.json or npm ls.
- Press the button to ask OSV.
- Read the table, worst first. “Fixed in” is the lowest release above yours with the fix.
About this tool
An npm project pulls in hundreds of packages, and most advisories you will meet are about one of them at one version: lodash 4.17.15, minimist 1.2.5. This checker takes a package name and an exact version and lists the known vulnerabilities that cover it, with the release that fixes each. Nothing is installed and no install scripts run, which matters when the package is one you do not trust yet.
Write the name as it appears in package.json. Scoped packages keep their scope: @babel/traverse, not traverse. Names are matched exactly, capitals included: new packages must be lower case, and a few old ones, such as JSONStream, keep their capitals. Take the version from package-lock.json or from npm ls, not from package.json: “^4.17.0” there is a range, and the lockfile says which version it resolved to.
The data comes from OSV, which carries the GitHub Advisory Database that npm audit uses as well, plus the malicious packages database. The difference is scope. npm audit needs a project with a lockfile and reports on the whole tree. This page answers for a single version, so you can check a package before you add it or look up a version named in a ticket.
Sources
Questions
npm audit sends the dependency tree of an installed project to the registry and reports every advisory in it. This checker looks at one package version and needs no project. Use it to vet a package before installing it, or to answer whether a given version is affected.
Run npm ls followed by the package name, or search package-lock.json for it. The version in package.json is usually a range such as ^4.17.0; the lockfile holds the version that was installed.
No. It checks the package you name at the version you give. A package with no advisories of its own can still depend on a vulnerable one. For the whole tree, scan the lockfile.
The “Fixed in” column shows the lowest fixed release above your version, even when that crosses a major version. Check the package’s changelog for breaking changes, and whether the maintainers also patched your release line.