Critical Malicious Code Vulnerability in dotenv-expanded Package
Summary
MAL-2026-415: Malicious code in dotenv-expanded (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
The dotenv-expanded package is a popular npm module used for loading environment variables from .env files into Node.js applications. It simplifies the management of configuration settings, making it easier for developers to handle sensitive information like API keys and database credentials. However, this package has been found to contain malicious code that compromises the security of any system using it.
Vulnerability Detail
The vulnerability originates from the inclusion of malicious code within the dotenv-expanded package. This code can fully compromise any computer that has the package installed, allowing unauthorized access to sensitive information such as secrets and keys. The implications of this vulnerability are severe, as it can lead to data breaches and unauthorized control over affected systems. Users are advised to treat any system running this package as compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall dotenv-expanded
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, you can temporarily replace dotenv-expanded with a safer alternative for managing environment variables, such as dotenv. To do this, uninstall dotenv-expanded using: npm uninstall dotenv-expanded, and then install dotenv with: npm install dotenv.
Conclusion
The dotenv-expanded package has been identified as containing malicious code that poses a significant security risk. Users are strongly advised to remove the package and take immediate action to secure their systems. Utilizing tools like Vulert can help in monitoring for such vulnerabilities in the future.
See every vulnerability recorded for dotenv-expanded →
FAQ
Immediately uninstall the dotenv-expanded package and rotate any secrets or keys stored on the affected system.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.
Leaving this vulnerability unaddressed can lead to unauthorized access to sensitive data, potential data breaches, and loss of control over your systems.
Currently, there is no patched version available. The best course of action is to remove the package entirely.
Vulert uses your package-lock.json file to monitor and alert in real-time for open-source vulnerabilities, ensuring your software remains secure.