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
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.
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:
- 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
latesttag when your range allows it, otherwise the highest matching version that is not deprecated. - Asks OSV about every package version in batches, through its
querybatchendpoint, with the ecosystem set to npm. - 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:
- 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. - A record from the GitHub Advisory Database carries GitHub's own rating, which the scanner shows as written: Critical, High, Moderate or Low.
- 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.
- 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
| Item | CVSS v3 score | Source |
|---|---|---|
| Critical | 9.0 to 10.0 | first.org |
| High | 7.0 to 8.9 | first.org |
| Moderate CVSS calls this Medium. | 4.0 to 6.9 | first.org |
| Low | 0.1 to 3.9 | first.org |
| Malicious | No safe version | docs.github.com |
| Item | Examples | Source |
|---|---|---|
| Permissive 225 licenses on Blue Oak list version 16 | MIT, Apache-2.0, ISC, BSD-3-Clause | blueoakcouncil.org |
| Weak copyleft 24 licenses on Blue Oak list version 11 | LGPL-3.0-only, MPL-2.0, EPL-2.0 | blueoakcouncil.org |
| Strong copyleft 11 licenses on Blue Oak list version 11 | GPL-2.0-only, GPL-3.0-only | blueoakcouncil.org |
| Network copyleft 20 licenses on Blue Oak list version 11 | AGPL-3.0-only, SSPL-1.0, EUPL-1.2 | blueoakcouncil.org |
| Maximal copyleft 6 licenses on Blue Oak list version 11 | RPL-1.5, Parity-7.0.0 | blueoakcouncil.org |
| Item | Rate | Source |
|---|---|---|
| Queries per batch request | 1,000 | github.com |
| Rate limit | None currently | google.github.io |
| Response size over HTTP/1.1 | 32 MiB | google.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
Every fact on this page was read from these pages on .
- OSV API docs, POST /v1/querybatchgoogle.github.io/
osv.dev/ post-v1-querybatch/ - OSV API docs, GET /v1/vulns/{id}google.github.io/
osv.dev/ get-v1-vulns/ - OSV API docs, overview and limitsgoogle.github.io/
osv.dev/ api/ - OSV Go client, batch query limitgithub.com/
google/ osv.dev/ blob/ master/ bindings/ go/ osvdev/ osvdev.go - OSV data sourcesgoogle.github.io/
osv.dev/ data/ - OSV schemaossf.github.io/
osv-schema/ - GitHub docs, About the GitHub Advisory Databasedocs.github.com/
en/ code-security/ security-advisories/ working-with-global-security-advisories-from-the-github-advisory-database/ about-the-github-advisory-database - FIRST, CVSS v3.1 Specificationfirst.org/
cvss/ v3.1/ specification-document - npm registry docs, package metadatagithub.com/
npm/ registry/ blob/ main/ docs/ responses/ package-metadata.md - npm-pick-manifestgithub.com/
npm/ npm-pick-manifest - npm docs, package.json license and overridesdocs.npmjs.com/
cli/ v11/ configuring-npm/ package-json - npm docs, npm auditdocs.npmjs.com/
cli/ v11/ commands/ npm-audit - pnpm lockfile spec, version 9.0github.com/
pnpm/ spec/ blob/ master/ lockfile/ 9.0.md - pnpm docs, lockfile documentspnpm.io/
lockfile - SPDX license expressionsspdx.github.io/
spdx-spec/ v3.0.1/ annexes/ spdx-license-expressions/ - Blue Oak Council, copyleft listblueoakcouncil.org/
copyleft - Blue Oak Council, permissive license listblueoakcouncil.org/
list
Found something out of date? Tell us.
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.