Malicious Code Detected in hardhat-gas-tracker: Version 1.0.1 Compromised
Summary
MAL-2026-11020: Malicious code in hardhat-gas-tracker (npm). Affects hardhat-gas-tracker versions 1.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
hardhat-gas-tracker is an npm package designed to track gas usage in Ethereum smart contracts, providing developers with insights into transaction costs and optimization opportunities. This package is widely used in the Ethereum development community for its utility in managing gas fees effectively. However, version 1.0.1 has been flagged for containing malicious code that compromises its integrity and user security.
Vulnerability Detail
The vulnerability in hardhat-gas-tracker stems from its communication with a domain associated with malicious activities. This connection poses significant risks, including data theft, unauthorized access to sensitive information, and potential exploitation of the user's environment. The malicious nature of the package was identified by the OpenSSF Package Analysis project, which highlighted the dangers of using this compromised version.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall hardhat-gas-tracker
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 you cannot immediately update the package, consider temporarily removing it from your project or replacing it with an alternative gas tracking solution until a secure version is available.
Conclusion
The hardhat-gas-tracker package version 1.0.1 has been identified as malicious due to its communication with harmful domains. It is essential for developers using this package to update to a secure version promptly to protect their applications and data. Utilizing tools like Vulert can further enhance security by monitoring for vulnerabilities in real-time.
See every vulnerability recorded for hardhat-gas-tracker →
FAQ
hardhat-gas-tracker is an npm package used for tracking gas usage in Ethereum smart contracts, helping developers optimize transaction costs.
Version 1.0.1 communicates with a domain linked to malicious activities, posing risks to user data and security.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Consider removing the package from your project or using an alternative solution until a secure version is available.
Vulert monitors and alerts for open-source vulnerabilities in your software using just the package-lock.json file, providing real-time insights.