Malicious Code Detected in hardhat-node Package - Version 1.0.2
Summary
MAL-2026-1053: Malicious code in hardhat-node (npm). Affects hardhat-node versions 1.0.1 – 1.0.2. 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-node package is a popular tool within the Ethereum development ecosystem, primarily used for creating and managing local Ethereum networks for testing smart contracts. It provides developers with a flexible environment to deploy and test their decentralized applications (dApps). However, version 1.0.2 of this package has been flagged for malicious activity, raising concerns about its integrity and security.
Vulnerability Detail
The vulnerability in the hardhat-node package arises from its communication with a domain associated with malicious activities. This behavior poses significant risks, including potential data breaches, unauthorized access to sensitive information, and the possibility of introducing malware into the development environment. The malicious nature of this package was identified by the OpenSSF Package Analysis project, which highlights the importance of scrutinizing third-party dependencies in software development.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall hardhat-node
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
If immediate updating is not feasible, consider removing the hardhat-node package from your project and replacing it with an alternative package that provides similar functionality without the associated risks. You can also monitor your application for vulnerabilities using tools like Vulert, which analyzes your package-lock.json file to alert you in real-time about any open-source vulnerabilities.
Conclusion
The hardhat-node package version 1.0.2 has been identified as malicious due to its communication with a harmful domain. It is crucial for developers to stay vigilant about the packages they use and to regularly update them to mitigate security risks. Utilizing tools like Vulert can aid in monitoring and managing vulnerabilities effectively.
See every vulnerability recorded for hardhat-node →
FAQ
hardhat-node is a tool used in Ethereum development for creating and managing local Ethereum networks for testing smart contracts.
Version 1.0.2 communicates with a domain linked to malicious activities, posing security risks to users.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Consider removing the hardhat-node package and using an alternative, or monitor your application for vulnerabilities using tools like Vulert.
Utilize tools like Vulert that monitor your package-lock.json file for real-time alerts on open-source vulnerabilities.