Malicious Code Detected in hardhat-zet Package: A Supply-Chain Threat
Summary
MAL-2026-17234: Malicious code in hardhat-zet (npm). Affects hardhat-zet versions 2.0.1. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The hardhat-zet package, version 2.0.1, is a Node.js package that appears to target developers in the Ethereum ecosystem. It is designed to integrate with the Hardhat Ethereum tooling, which is widely used for developing smart contracts. However, this package has been found to impersonate the Hardhat ecosystem, raising significant security concerns due to its malicious nature.
Vulnerability Detail
The vulnerability stems from the hardhat-zet package being a trojan horse, where its README and documentation are copied from the unrelated pino logger project. The package exports a no-op middleware and contains a large, obfuscated payload that executes automatically upon import. This obfuscation makes it difficult to observe its behavior, posing a risk of supply-chain attacks targeting Ethereum developers. The malicious code is designed to steal sensitive information, making it a serious threat.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall hardhat-zet
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary measure, avoid using the hardhat-zet package and ensure that your project does not include it in your dependencies. Regularly audit your package.json and package-lock.json files to identify and remove any suspicious packages.
Conclusion
The hardhat-zet package poses a significant risk to developers in the Ethereum ecosystem due to its malicious code and deceptive practices. It is essential to remove this package from your projects and monitor for vulnerabilities using tools like Vulert to ensure the security of your applications.
See every vulnerability recorded for hardhat-zet →
FAQ
hardhat-zet is a Node.js package that falsely claims to be part of the Hardhat Ethereum tooling ecosystem but contains malicious code.
The malicious code is obfuscated and executes automatically when the package is imported, making it difficult to detect its harmful actions.
You should immediately uninstall the package using 'npm uninstall hardhat-zet' and check your project for any other suspicious dependencies.
You can use Vulert, which monitors your package-lock.json for open-source vulnerabilities in real-time. You can check your application for vulnerabilities using the Vulert playground without needing to sign up.
Yes, consider using legitimate packages from the Hardhat ecosystem or other well-known libraries that are actively maintained and have a good reputation.