hardhat-packnpm
Advisory published Updated
hardhat-pack is a confirmed malicious npm package (MAL-2026-17661) that steals credentials and exfiltrates sensitive data (malicious version 2.0.1). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in hardhat-pack (npm)
What this malware does
The package is published as hardhat-pack, a name shape that resembles the Hardhat Ethereum tooling ecosystem, but its README, LICENSE, TypeScript declarations and library source are copied verbatim from the unrelated pino logger. The only material divergence from upstream pino is that index.js adds const config = require('./lib/config'); at the top level, and lib/config.js is a single-line 4.4MB obfuscator.io payload: an IIFE with a ~26,000-entry hex-escaped string array and a rotating decoder. Nothing in the shipped source references config for a legitimate purpose, and the package carries no native build, no vendored SDK, and no other justification for a multi-megabyte opaque blob. The package also declares axios as a runtime dependency, consistent with network exfiltration or remote fetch from inside the decoded payload. Any process that imports hardhat-pack hands the opaque payload to the JavaScript engine on first require.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Credential / info stealerFind it
Search your lockfiles and build artifacts for hardhat-pack (version 2.0.1).
If you installed it — respond
hardhat-pack is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.
Did it already run?
If hardhat-pack 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-pack-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.