Check package-lock.json for vulnerable dependencies
Upload or paste your package-lock.json. We check every JavaScript package version in it
against OSV.dev and email you the
vulnerable ones, the version that fixes them and the npm command to upgrade. Free, and no account needed.
About package-lock.json
package-lock.json is written by npm next to package.json. It records the exact version of every package in node_modules, including the deep tree of indirect dependencies, which is where most npm advisories are.
To write or refresh it:
npm install --package-lock-only
This writes the lockfile without downloading node_modules. Commit it.
Good to know
- package.json cannot be checked: ^4.17.0 means "4.17.0 or any later 4.x".
- Both lockfile formats are read: v1 (npm 6) and v2/v3 (npm 7 and later).
- Development dependencies are checked too: build tools run on your machines and in CI.
Fixing a vulnerable package
The report gives the fixed version for each vulnerable package (FIXED below). With npm:
# Upgrade a direct dependency to the fixed version
npm install package@FIXED
# Or, for an indirect one, update it within its parents' ranges
npm update package
If a parent package pins an old version, upgrade the parent, or force the version with "overrides" in package.json (npm 8.3 and later), then run npm install.
Then run your tests and commit the updated package-lock.json.
npm audit and this check
npm audit is built in and uses the GitHub Advisory Database, which OSV.dev includes. This check needs no install, works the same way for your Python, Go or Ruby projects, and groups advisories per package with one target version.
Other lockfiles
Questions
npm audit already shows these. Why use this?
If npm audit is part of your workflow, keep it. This check is useful without a terminal, for several ecosystems at once, and as a first step towards daily alerts with a free account.
Related free tools
GitHub repo vulnerability check
Paste a public GitHub repo URL. We find every lockfile, check each package version against OSV.dev and email you the fixes. Free, no account.
Dependency vulnerability check
Check requirements.txt, package-lock.json, poetry.lock and more against OSV.dev. Free report by email with fix commands. No account needed.
Last updated .