Critical Malicious Code Vulnerability in dotenv-expanded Package

dotenv-expanded Updated 23 Jan 2026

Summary

21/01/2026
CRITICAL
No i
Critical
Not published

MAL-2026-415: Malicious code in dotenv-expanded (npm). Affected versions are not published. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback