Malicious Code Vulnerability in node-cli-dotenv Package

node-cli-dotenv Updated 19 Mar 2026

Summary

18/03/2026
CRITICAL
No i
Critical
Not published

MAL-2026-1802: Malicious code in node-cli-dotenv (npm). Affects node-cli-dotenv versions 2.4.5. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

node-cli-dotenv is an npm package designed to facilitate the loading of environment variables from a .env file into Node.js applications. It simplifies the management of environment configurations, making it easier for developers to handle sensitive information securely. However, this package has been identified to contain malicious code, posing significant security risks to applications that utilize it.

Vulnerability Detail

The vulnerability in node-cli-dotenv stems from the inclusion of malicious code that can execute unauthorized actions within the user's environment. This issue was reported by ReversingLabs and affects version 2.4.5 of the package. The malicious code can lead to data breaches, unauthorized access, and potential system compromise, making it critical for users to address this vulnerability promptly.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall node-cli-dotenv

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, users can remove the node-cli-dotenv package from their project until a secure version is confirmed. This can be done using the command: 'npm uninstall node-cli-dotenv'. Alternatively, consider using a different package for managing environment variables that does not have known vulnerabilities.

Conclusion

The discovery of malicious code in the node-cli-dotenv package highlights the importance of maintaining secure coding practices and regularly updating dependencies. Users are urged to take immediate action to mitigate the risks associated with this vulnerability.

See every vulnerability recorded for node-cli-dotenv →

Share this vulnerability

FAQ

node-cli-dotenv is an npm package that loads environment variables from a .env file into Node.js applications.

The malicious code can execute unauthorized actions, potentially leading to data breaches and system compromise.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Check your application against the vulnerability using the Vulert playground without any signup.

Version 2.4.5 of node-cli-dotenv is known to contain the malicious code.

Regularly update your dependencies and monitor them for vulnerabilities using tools like Vulert to ensure your application remains secure.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall node-cli-dotenv

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