Skip to main content
MalwarePublished Updated

hardhat-cap (npm) · Malicious Code

Affects hardhat-capSource GCVE Database

0

Malicious package : remove hardhat-cap and rotate any secrets on hosts that installed it.

Data as of 26 Oct 2026, 16:15 UTC

Classification

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

ProductAffectedFixed in
npmhardhat-capAffected
  • =2.21.1
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.

References

Community reviews

Loading reviews…