How do I check if an npm package I installed is compromised by a supply chain attack?

Updated 2026-11-15

Short answer: list the exact version of the package installed in each project with npm ls <package> --all or the lockfile, then check that name and version against the malware advisories in OSV and the GitHub Advisory Database, the same advisories npm audit returns. A clean result only means nobody has reported that version yet: for four malicious npm releases in 2026 the advisory appeared 50 minutes to 1 hour 44 minutes after the release, so for anything installed around an incident you also read what the package runs.

1. Find out exactly what you have installed

The version in package.json is a range. What counts is the version that was installed, including transitive dependencies you never added. StepSecurity found parent packages of @subql/common asking for ~5.8.2, a range that also accepts the malicious 5.8.3.

npm ls <package> --all
npm explain <package>
pnpm why <package>
yarn why <package>
grep -n -A3 '"node_modules/<package>"' package-lock.json
git log -p --since=2026-11-01 -- package-lock.json

npm explain shows which dependency pulled a version in (Chainguard). The git log line shows when the lockfile changed, which tells you whether a bad version could have been installed during an incident. Projects you are not working on today count too:

find ~ \( -name package-lock.json -o -name pnpm-lock.yaml -o -name yarn.lock \) -not -path '*/node_modules/*' 2>/dev/null

2. Compare against known-compromised versions

Advisory databases

GitHub publishes malware advisories automatically from the npm security team and the OpenSSF Malicious Packages repository. A malware advisory has no fixed version, because no version of a malicious package is safe (GitHub docs). npm audit sends your dependency list to the registry and reports known vulnerabilities; it needs a package-lock by default (npm docs). On 15 November 2026 the registry's bulk advisory endpoint, the one npm audit calls, returned a critical "Malware in keyv" advisory for keyv =6.0.0 and matching advisories for the other three versions in the table below. To ask OSV about one version without installing anything:

npm audit
npm audit --json
curl -s -X POST https://api.osv.dev/v1/query \
  -d '{"package":{"name":"keyv","ecosystem":"npm"},"version":"6.0.0"}'

For keyv 6.0.0 OSV answers with MAL-2026-11524, alias GHSA-3p9h-f68w-m6fx (checked 15 November 2026). On GitHub, search the Advisory Database for type:malware and the package name.

The window before an advisory exists

PackageBad versionOn npm (UTC)Advisory in OSV (UTC)GapFixLane page
keyv6.0.04 Aug 2026, 09:3511:191 h 44 minincident 1758
@subql/common5.8.35 Oct 2026, 11:5612:4650 minincident 1767
tensorlake0.5.1448 Oct 2026, 01:1202:541 h 42 minin review
@ethersphere/bee-js13.3.09 Nov 2026, 00:0901:251 h 16 minincident 1907

Release times are from the npm registry's metadata, advisory times from the OSV API, both read on 15 November 2026. During each gap there was no advisory for npm audit to report. Dependabot has the same limit: GitHub says new malware may take time to appear in the Advisory Database and trigger alerts.

Vendor advisories for a named incident

Research teams publish the bad versions and the files a payload leaves: Wiz for keyv, whose wave spread to more than 400 npm packages, and StepSecurity for @subql/common, tensorlake and @ethersphere/bee-js. The keyv guide and the Shai-Hulud guide list the files to search for. Other malicious npm packages FixLane has pages for: litecore-lib-ltc, the MemTensor memory plugin and indexed-btree.

Ready-made lists go stale

Scripts that compare your lockfile with a bundled list only know the attacks from before their last release. scan-compromised 1.1.236, published 22 July 2026, ships a threats.json with 3,537 package names; on 15 November 2026 it had no entry for keyv, @subql/common, tensorlake or @ethersphere/bee-js. worm-sign 4.2.0, published 18 May 2026, covers the TanStack, Axios and Shai-Hulud 2.0 campaigns (its Socket page).

Scanner tools compared

ToolWhat it checksFix guidanceWhat it needsLicense
npm auditThe tree in your package-lock against registry advisories, malware includednpm audit fix installs versions without an advisory; malware advisories have no fixed versionShips with npmPart of the npm CLI
GitHub Advisory Database, Dependabot malware alertsYour repository's default branch on GitHubAlerts with suggested remediation stepsAlerts turned on for the repositoryDatabase: CC-BY-4.0
OSV-ScannerLockfiles, 19+ types, against OSV.devExperimental guided remediation (osv-scanner fix)A downloaded binary, no keyApache-2.0
Socket CLIDependency scans through Socket's API, and npm or npx installs it wrapssocket fix for CVEs, security patchesAn API token for scansMIT
Snyk CLIProject manifests with snyk testEach vulnerability with its path and fix guidanceInstall and authenticate with a Snyk accountApache-2.0
Aikido Safe ChainPackage downloads as they happen, through a local proxy, against Aikido Intel's malware feed; blocks packages newer than 48 hoursBlocks the downloadAn install script; free, no tokenAGPL or commercial
FixLaneA package, program or CVE id against FixLane's verified incidentsA reviewed procedure per incident and OS through get_fix_promptAny MCP client or the Telegram bot, no account or keyPlugin: MIT

Each row comes from the tool's own docs or repository, read on 15 November 2026.

3. Inspect the package itself

npm view <package>@<version> scripts
npm view <package> time --json
npm approve-scripts --allow-scripts-pending
npm audit signatures

4. If you think you are affected

Treat every machine and CI runner that installed the version as exposed: these payloads steal tokens and keys when they run (Wiz, StepSecurity). Do not start by revoking tokens. tensorlake installs a service that checks the stolen GitHub token every 60 seconds for up to 24 hours and runs rm -rf ~/ when GitHub rejects it (StepSecurity), and the keyv payload can arm the same kind of switch (Wiz). The safe order is in the Shai-Hulud guide. This page has no fix steps: FixLane serves the reviewed procedure for each incident, a read-only check first, through get_fix_prompt and the Telegram bot.

Check with FixLane

An AI agent connected to the free FixLane MCP server can run the read-only checks above and ask FixLane about each package. check_software for keyv returned this on 15 November 2026 at 17:50 UTC:

keyv - 1 known issue since 2026-08-01 · 1 exploited
- keyv: Hijacked keyv and cacheable npm packages in a supply chain attack (incident 1758, unknown, exploited in the wild, published 2026-08-04, fix prompt available)

For packages, use check_software and compare your version with the one the incident names. check_inventory compares versions with verified fixed versions, and a malicious release has none, so the same day it answered keyv 6.0.0 with "unknown" and the related incident 1758 rather than "affected".

Questions

Does npm audit detect malicious packages?

Yes, once an advisory exists. On 15 November 2026 npm's advisory endpoint returned a critical "Malware in keyv" advisory for keyv 6.0.0. Before the advisory is published it reports nothing: for four malicious npm releases in 2026 that gap was 50 minutes to 1 hour 44 minutes.

How do I check one npm package version without installing it?

Run npm view <package>@<version> scripts to see its install scripts, and ask OSV: a POST to https://api.osv.dev/v1/query with the package name, npm and the version. A malicious version comes back with a MAL- id, for example MAL-2026-11524 for keyv 6.0.0.

Does npm provenance mean a package is safe?

No. Provenance shows where a package was built. keyv 6.0.0 and tensorlake 0.5.144 were both built from their real repositories and carried valid provenance.

Is a list of compromised npm packages enough?

Only for attacks from before the list was last updated. scan-compromised 1.1.236, published 22 July 2026, has no entry for keyv, @subql/common, tensorlake or @ethersphere/bee-js.

What should I do first if I find a compromised package?

Do not revoke tokens first: some payloads delete your home directory when their stolen token is revoked. Treat the machine as exposed and follow the reviewed procedure for that incident, which FixLane serves through get_fix_prompt and its Telegram bot.

Sources

Check your own machine

Connect an AI agent to the free, read-only FixLane MCP server or ask the Telegram bot: it checks what you have installed against verified fixed versions and serves a reviewed fix procedure. All guides.