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.

or paste its content

Needed when you paste. package.json and pyproject.toml only have version ranges: use the lockfile next to them.

Only package names and versions are checked; the file itself is not kept. We use your email to send this report and nothing else unless you tick the box above. Privacy policy.

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.

Last updated .