Remote Code Execution Vulnerability in mini-hardhat Package
Summary
MAL-2026-17236: Malicious code in mini-hardhat (npm). Affects mini-hardhat versions 1.1.4. 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 mini-hardhat package, version 1.1.4, is designed to function as a JSON logger similar to pino. It is intended for logging and vulnerability management. However, it has been found to contain malicious code that compromises the security of applications using this package.
Vulnerability Detail
The vulnerability originates from the package's main entry, which exports a middleware factory that spawns a detached child process. This child process executes lib/caller.js, which base64-decodes a hardcoded URL and sends a POST request to it. The response is then executed as code within the consumer's Node.js process, allowing for arbitrary code execution. This poses a significant risk as it can lead to unauthorized access and control over the affected system.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall mini-hardhat
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 workaround, you can remove the mini-hardhat package from your project until a secure version is released. You can do this by executing the command: npm uninstall mini-hardhat.
Conclusion
The mini-hardhat package version 1.1.4 contains a serious vulnerability that allows for remote code execution. It is crucial for developers to update or remove this package to safeguard their applications. Utilizing tools like Vulert can help in monitoring and managing open-source vulnerabilities effectively.
See every vulnerability recorded for mini-hardhat →
FAQ
The vulnerability allows for remote code execution through a malicious payload that is executed in the consumer's Node.js process.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Check your application using the Vulert playground at Vulert Scanner.
If an immediate update is not possible, consider removing the package as a temporary measure to protect your application.
While specific exploits have not been publicly disclosed, the nature of the vulnerability allows for arbitrary code execution, which can be exploited by attackers.
Regularly check for updates to your packages and use tools like Vulert to monitor vulnerabilities in real-time.