Skip to content

package.json Vulnerability Scanner and npm License Check

Scan a package.json and lockfile against the OSV database for known vulnerabilities and malware, and flag copyleft or missing licenses. Free, in your browser.

  • Asks the OSV database
  • Reads the npm registry

Checked

01Tool

Tool

Required
Optional
package-lock.json or pnpm-lock.yaml, for the exact versions you installed, transitive ones included.
Show advisories

Paste a package.json to check its packages against the OSV vulnerability database and read the license of each direct dependency. Add a lockfile to check every version you installed.

Your files are read in this browser. When you press Check packages, the names and versions of your packages go to the OSV database (api.osv.dev) and the npm registry (registry.npmjs.org). The pasted files never go into the page address.

02Guide

How it works

What the scanner checks

Paste a package.json and the scanner reads its dependencies, devDependencies and optionalDependencies in your browser. Nothing leaves the page until you press Check packages. Then it does three things:

  1. Pins a version for each direct dependency. With a lockfile, that is the version you installed. Without one, it asks the npm registry for the package's versions and picks the one npm would install today: the latest tag when your range allows it, otherwise the highest matching version that is not deprecated.
  2. Asks OSV about every package version in batches, through its querybatch endpoint, with the ecosystem set to npm.
  3. Loads each advisory OSV returns: its severity, summary, affected ranges, fixed versions and aliases, with a link to the full record on osv.dev.

It also reads each direct dependency's manifest on npm for its license. The numbers it relies on, from the severity scale to OSV's limits, are in the table further down.

Why the lockfile matters

A range such as ^4.17.0 allows every 4.x release from 4.17.0 up, so the package.json alone cannot say what you run. The lockfile can. It records the exact version of every package in the install, including the dependencies of your dependencies.

The scanner reads package-lock.json from npm, in lockfile versions 1 to 3, and pnpm-lock.yaml from version 5 to version 9. For pnpm it reads the keys of every packages section, such as vue@3.5.13, and drops the peer suffix pnpm adds in parentheses. That includes the first document pnpm writes into the same file for config dependencies and its own version, which a scanner reading only one document would miss. Entries that name no registry version, such as git, file and link dependencies, are counted and skipped.

Without a lockfile, a clean result says only that today's versions of your direct dependencies have no known advisory. Run it again with the lockfile before you trust it.

How severity is read

OSV records come from several databases, and the scanner reads their severity in this order:

  1. A record from the OpenSSF Malicious Packages repository, with an ID starting MAL-, is malicious. There is no safe version of a malicious package; remove it.
  2. A record from the GitHub Advisory Database carries GitHub's own rating, which the scanner shows as written: Critical, High, Moderate or Low.
  3. A record with only a CVSS v3 vector gets its base score from the CVSS v3.1 equations and the rating that score falls in.
  4. Anything else shows as unrated. Open it on osv.dev to judge it yourself.

Where a record has a CVSS v3 vector, its base score appears beside the rating. GitHub's reviewers can rate an advisory outside its score's band, as with express's res.redirect XSS, rated Low with a base score of 5.0, so the two can disagree. A base score describes the flaw itself, not whether your code reaches it, so read the summary before you decide how fast to move.

How licenses are sorted

npm's license field holds an SPDX expression such as MIT or (MIT OR GPL-3.0-or-later), a pointer such as SEE LICENSE IN LICENSE.md, or UNLICENSED for a package that grants no rights to use it. Older packages use a license object or a licenses array, which the scanner also reads.

Each license ID is matched against the Blue Oak Council's permissive list and its copyleft list, which groups copyleft licenses into weak, strong, network and maximal families. In an expression, OR gives you the choice, so the most permissive option counts; AND binds you to both, so the most restrictive one counts. Deprecated IDs such as GPL-2.0 read as GPL-2.0-only, and GPL-2.0+ as GPL-2.0-or-later.

The check covers direct dependencies only, at the version that was checked. A family tells you what to read first, not what you may do. Whether a license fits depends on how you ship, so ask a lawyer when it matters.

When a package is vulnerable

Start with the advisory's fix line. When a fixed version is published, update the direct dependency, or the one that pulls the package in, to a release that uses it:

npm explain minimist
pnpm why minimist

When no release of the parent has moved yet, you can force the fixed version for the whole tree. npm reads overrides from package.json:

{
  "overrides": {
    "minimist": "1.2.8"
  }
}

pnpm reads overrides from pnpm-workspace.yaml. Either way, run your tests after, because the parent package was never tested against the version you forced.

A clean result is not a guarantee. OSV lists problems someone has found and reported, so scan again when you add a dependency and before each release.

03Rates

The numbers it uses

Severity
ItemCVSS v3 scoreSource
Critical 9.0 to 10.0first.org
High 7.0 to 8.9first.org
Moderate CVSS calls this Medium.4.0 to 6.9first.org
Low 0.1 to 3.9first.org
Malicious No safe versiondocs.github.com
License families
ItemExamplesSource
Permissive 225 licenses on Blue Oak list version 16MIT, Apache-2.0, ISC, BSD-3-Clauseblueoakcouncil.org
Weak copyleft 24 licenses on Blue Oak list version 11LGPL-3.0-only, MPL-2.0, EPL-2.0blueoakcouncil.org
Strong copyleft 11 licenses on Blue Oak list version 11GPL-2.0-only, GPL-3.0-onlyblueoakcouncil.org
Network copyleft 20 licenses on Blue Oak list version 11AGPL-3.0-only, SSPL-1.0, EUPL-1.2blueoakcouncil.org
Maximal copyleft 6 licenses on Blue Oak list version 11RPL-1.5, Parity-7.0.0blueoakcouncil.org
OSV API
ItemRateSource
Queries per batch request 1,000github.com
Rate limit None currentlygoogle.github.io
Response size over HTTP/1.1 32 MiBgoogle.github.io

04Questions

Questions

Is this the same as npm audit?
No. npm audit posts your dependency tree to your registry's bulk advisory endpoint and, by default, needs a lockfile. This scanner asks the OSV database, which collects advisories from sources including the GitHub Advisory Database and the OpenSSF Malicious Packages repository, and it also works from a package.json alone. npm audit fix goes further and runs an install; this page only reports, and you change versions yourself.
Do I need to paste a lockfile?
No, but it makes the result exact. Without one, the scanner checks only your direct dependencies, each at the version npm would install today. With package-lock.json or pnpm-lock.yaml it checks every version you installed, including the transitive packages your dependencies pull in.
Which lockfiles can it read?
package-lock.json in lockfile versions 1 to 3, and pnpm-lock.yaml from version 5 to version 9. It does not read yarn.lock or bun.lock; leave the lockfile empty for those projects and the direct dependencies are still checked.
Is my package.json uploaded?
Not to us. The files are parsed in your browser and never go into the page address. Only when you press Check packages do the names and versions of your packages go to api.osv.dev and registry.npmjs.org, straight from your browser.
Which licenses does it flag?
Strong, network and maximal copyleft licenses as the Blue Oak Council groups them, such as the GPL, AGPL and SSPL, plus packages marked UNLICENSED. It notes weak copyleft such as the LGPL and MPL, and asks you to read custom licenses, missing ones and any it cannot place. It sorts licenses so you know what to read first; it is not legal advice.
How do I fix a vulnerable transitive dependency?
First update the direct dependency that pulls it in, since a newer release often moves to a fixed version. npm explain or pnpm why shows the chain. If no such release exists, force the fixed version with overrides in package.json for npm, or overrides in pnpm-workspace.yaml for pnpm, then run your tests.

05Sources

Sources

Nuxter

Building a SaaS on Nuxt?

Nuxter's pnpm setup waits seven days before it installs a newly published version and lets only the packages it approves run install scripts, so a hijacked release has time to be caught before it reaches your project.

See what Nuxter includesFrom $249, one-time.