depguard

Was your machine hit?

When a hijacked npm package ships malware, the question is no longer whether to install it. It is whether it already reached any project on your machine. One command answers that in seconds.

$ npx depguard-cli exposure
How it works

Free and open source. Runs on your machine. Nothing about your projects leaves it.

What you see

An answer, not a report

Either nothing known is on your machine, or exactly which version is where, whether it was installed, and what to do next.


      
89,000+
malware advisories for npm packages in the last 11 months
3 places
projects, global installs and the npm cache, in one run
~15 s
to check 14,532 package versions on a real laptop
0
runtime dependencies in depguard itself
Where it looks

A lock file is a receipt. depguard reads all of them.

Every install leaves a record somewhere. The scan looks in the three places a malicious version can hide, and matches each exact version against the known-malicious database.

Every project

All lock files under your home directory: npm, pnpm, Yarn and Bun. Nested copies count, so a bad version buried three dependencies deep is still found.

~/work/**/package-lock.json

Global installs

Command-line tools you installed globally months ago and forgot about, including everything they pulled in.

$(npm root -g)

The download cache

Proof that a tarball was downloaded on this machine, and on which day, even if the project that asked for it is long gone.

~/.npm/_cacache

Exact versions only.

A false alarm would mean rotating every credential you own for nothing. Every database update is tested against known-clean versions and the most popular npm packages before it ships.

debug@4.4.2  hijacked debug@4.4.3  clean
Before you install

Check any package in seconds

The same engine as the CLI: known malware, vulnerabilities, license, maintenance and a 0 to 100 score. No install, no account.

Runs a live audit of the latest published version. Nothing is installed.

// Pick a package or type any name
// Full real-time security audit, powered by the depguard engine
$ depguard-cli audit ___
Inside the code

What depguard looks for in a package

It downloads the tarball and reads the actual source, so a package that does something its description never mentioned gets caught. Nothing is executed.

Malware patterns

Decoded payloads passed to eval, reverse shells, crypto miners.

Critical

Data exfiltration

Environment variables, SSH keys and tokens serialised and sent out.

Critical

Install scripts

preinstall and postinstall scripts that download and run code.

Critical

Code execution

eval, new Function and child processes where they have no business.

High

Obfuscation

Long encoded strings and minified source hidden from reviewers.

High

Behaviour mismatch

A "string formatter" that opens network connections is flagged.

Explained

The full security model

When it finds something

From "am I affected?" to a plan

Step 1

Scan

One command, no setup, no account. Point it at a folder, or let it read your whole home directory.

Step 2

Read the evidence

Every location of each malicious version, whether it is really installed, whether it runs install scripts, and when it was downloaded.

Step 3

Act on what matters

The steps scale with the evidence. If the version only sits in a lock file and never reached your disk, it says so, and you skip the credential rotation.

Incidents it knows about

Real attacks, real versions

A few of the cases in the database, from the GitHub Advisory Database and hand-checked advisories. New ones arrive every day.

May 2026
@tanstack/*many packages
Malicious releases across the TanStack packages exfiltrated cloud credentials and GitHub tokens.
September 2025
debug4.4.2
Maintainer account taken over. The same wave hit color, color-convert, error-ex and others.
July 2025
eslint-config-prettier10.1.7
A phished maintainer token published malware across several versions and sibling packages.
March 2022
node-ipc10.1.1
The maintainer shipped code that overwrote files on machines with Russian or Belarusian IPs.
January 2022
colors1.4.1
The author sabotaged his own package with an infinite loop, breaking thousands of builds.
October 2021
ua-parser-js0.7.29
Hijacked releases installed a cryptominer and a password stealer.
November 2018
event-stream3.3.6
A new maintainer added a dependency that targeted Copay bitcoin wallets.
Before the next one

The same tool works on the way in

Before you open a repo

A fake job interview can send a "take-home test" that runs malware the moment VS Code opens the folder. This lists everything that would run.

npx depguard-cli audit-workspace ./test-repo

Before you install

Checks that a package exists, is not a typosquat and has no known malware or vulnerabilities, then says allow, warn or block.

npx depguard-cli guard some-package

Inside your AI agent

Claude Code, Cursor and other agents ask depguard the same questions through MCP, before they install anything for you.

claude mcp add depguard -- npx -y depguard-cli --mcp
Daily ranking

The most installed npm packages, audited every morning

173 packages almost every project depends on, ranked by security score and re-checked daily. See the full ranking.

173Packages
168Clean
5Warnings
0Danger
15 OctLast scan
#PackageScoreVulnsDownloads
1semver7.8.5
98
0873.2M/w
2ansi-styles7.0.0
98
0695.5M/w
3commander15.0.0
97
0538M/w
4string-width8.3.0
97
0527.4M/w
5supports-color11.0.0
97
0503.4M/w
6chalk6.0.1
97
0496.3M/w
Questions

What people ask

How do I check if my machine was affected by an npm supply-chain attack?

Run npx depguard-cli exposure. It reads every lock file under your home directory, your global installs and the npm download cache, and reports any exact version known to be malicious, where it is, and what to rotate. On a typical developer laptop it takes about 15 seconds.

Was I affected by the debug and color compromise of September 2025?

Only if a project, a global install or your npm cache holds one of the hijacked versions, such as debug 4.4.2 or color 5.0.1. The command above checks all three at once. Other versions of those packages are not affected.

Does depguard send my dependency list anywhere?

No. The scan runs against a database bundled with the package. Nothing about your projects leaves your machine.

Will it flag clean versions of a package that was once compromised?

No. It only matches the exact versions listed in an advisory. Every database update is tested against known-clean versions and the most popular npm packages before it ships.

What happens if it finds something?

It lists every place the malicious version appears, whether it is actually installed, whether it runs install scripts and when it was downloaded, followed by the steps to take. If the version only sits in a lock file and never reached your disk, it tells you that too.

How is this different from npm audit?

npm audit looks at one project at a time, and only at what that project's lock file lists. depguard looks at every project on the machine, the packages you installed globally and the cache of everything npm has downloaded, in a single run.

Setup, MCP tools and scoring in the docs

Fifteen seconds to know for sure

Run it now, and again the next time a worm makes the news.

$ npx depguard-cli exposure