hardhat-plusnpm
Advisory published Updated
hardhat-plus is a confirmed malicious npm package (MAL-2026-17508) that typosquats a legitimate package to trick installs (malicious version 2.21.0). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in hardhat-plus (npm)
What this malware does
[email protected] is published under a name resembling the Ethereum development tool 'hardhat' but ships README, type definitions, and docs copied verbatim from the unrelated pino logger project (README.md references npmjs.com/package/pino; index.d.ts references github.com/pinojs/pino.git; package.json description is unrelated boilerplate). The package's main entry index.js requires./lib/config, which is a single ~4.5MB heavily obfuscated file using obfuscator.io transforms: hex-named identifiers, a self-mutating shuffled string-array (while(!![]){...f'push'}), control-flow flattening, dispatched decode helpers, and pervasive \xNN escape literals. This opaque code runs unconditionally the moment the package is imported. There is no legitimate source, minification story, or documented purpose that accounts for a multi-megabyte obfuscated blob being loaded as a 'config' module in a package that presents itself as either a Hardhat plugin or a pino logger. The combination of name-based impersonation, mismatched cover-story documentation, and an obfuscated payload auto-executed on import is the standard delivery shape for supply-chain malware.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
TyposquatFind it
Search your lockfiles and build artifacts for hardhat-plus (version 2.21.0).
If you installed it — respond
hardhat-plus is a typosquat — you almost certainly intended a legitimately-named package. Remove hardhat-plus, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.
Did it already run?
If hardhat-plus was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks hardhat-plus-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.