hardhat-cap (npm) · Malicious Code
Affects hardhat-capSource GCVE Database
Malicious package : remove hardhat-cap and rotate any secrets on hosts that installed it.
Data as of 26 Oct 2026, 16:15 UTC
Malicious package
Published to npm · OSV MAL-2026-13616
What to do
Remove hardhat-cap from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmhardhat-cap | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The npm package 'hardhat-cap' version 2.21.1 contains malicious code disguised within an obfuscated module. The package superficially mimics the pino logger but includes a large, heavily obfuscated payload that executes arbitrary code upon import. This behavior is consistent with a typosquatting attack designed to trick users into executing malicious code when requiring the package.