hardhat-corenpm
Advisory published Updated
hardhat-core is a confirmed malicious npm package (MAL-2026-3713) that typosquats a legitimate package to trick installs (malicious versions 1.0.0, 2.1.2). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in hardhat-core (npm)
What this malware does
hardhat-core version 2.1.2 spawns a detached Node.js child process from index.js that runs lib/caller.js. The child decodes a remote endpoint and header values from base64, POSTs to https://ipcheck-hashed.vercel.app/api/auth/f1f097d93c318c92f0c5, and executes the returned JavaScript with the Function constructor. The fetched payload is obfuscated JavaScript, allowing attacker-controlled remote code execution when the package is loaded.
The package impersonates the Ethereum hardhat toolchain (README self-identifies as hardhat-base, copies pino badges). Its main index.js exports a middleware that spawns lib/caller.js as a detached node process when the package is used. lib/caller.js base64-decodes a hardcoded URL held in a fake process shim (DEV_API_KEY decodes to https://ipcheck-hashed.vercel.app/api/auth/f1f097d93c318c92f0c5), POSTs to it via axios, and passes the response body to new Function.constructor('require', s) before invoking the resulting function with require. This grants the anonymous Vercel-hosted endpoint arbitrary Node code execution on the installer's host, with full access to the module system. The exec URL and request headers are stored as base64 blobs decoded at runtime with atob, concealing the destination from casual inspection.
The OpenSSF Package Analysis project identified 'hardhat-core' @ 1.0.0 (npm) as malicious.
It is considered malicious because:
- The package executes one or more commands associated with malicious behavior.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
TyposquatFind it
Search your lockfiles and build artifacts for hardhat-core (2 malicious versions).
If you installed it — respond
hardhat-core is a typosquat — you almost certainly intended a legitimately-named package. Remove hardhat-core, 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-core 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
- ESTsecurity · finder
- OpenSSF: Package Analysis · finder
Detect & block this
O3 blocks hardhat-core-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.