Critical Malicious Code Vulnerability in node-dotenv-cli Package
Summary
MAL-2026-853: Malicious code in node-dotenv-cli (npm). Affected versions are not published. 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
node-dotenv-cli is a command-line interface for managing environment variables in Node.js applications. It allows developers to load environment variables from a .env file into process.env, facilitating configuration management. However, this package has been compromised, leading to severe security risks for systems using it.
Vulnerability Detail
The vulnerability originates from a malicious code embedded within the node-dotenv-cli package. Any system with this package installed is considered fully compromised, potentially allowing unauthorized access to sensitive information such as secrets and keys. The malicious code can lead to complete control of the affected computer by external entities, making it imperative for users to act swiftly to mitigate risks.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall node-dotenv-cli
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 workaround, users should uninstall the node-dotenv-cli package using the command: npm uninstall node-dotenv-cli. However, be aware that simply removing the package may not eliminate all malicious software that has been installed as a result of this vulnerability.
Conclusion
The node-dotenv-cli package has been compromised with malicious code, posing significant risks to any system using it. Immediate action is required to remove the package and secure sensitive information. Users are encouraged to utilize tools like Vulert to monitor for vulnerabilities in their applications.
See every vulnerability recorded for node-dotenv-cli →
FAQ
node-dotenv-cli is a tool for managing environment variables in Node.js applications, allowing developers to load variables from a .env file.
The malicious code can grant unauthorized access to your system, potentially compromising sensitive information and allowing external control.
Immediately uninstall the node-dotenv-cli package and rotate any secrets or keys stored on the affected system.
Yes, you can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.
While removing the package is essential, it may not eliminate all malicious software. A thorough security assessment of your system is recommended.