Malicious Code Execution Vulnerability in dotenv-native Package

dotenv-native Updated 29 Sep 2026

Summary

28/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17231: Malicious code in dotenv-native (npm). Affects dotenv-native versions 1.0.1. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The dotenv-native package is a Node.js library that typosquats the popular dotenv family, which is widely used for loading environment variables from a .env file into process.env. This package is intended to simplify the management of environment variables in Node.js applications. However, it has been found to contain malicious code that executes an attacker-controlled payload upon loading the module, posing significant security risks to applications that depend on it.

Vulnerability Detail

The vulnerability originates from the dotenv-native package, which executes a malicious payload when the module is loaded. Specifically, the package contains a routine that opens a bundled JPEG file, scans it for an APP1/EXIF marker, and extracts the contents to execute a command using PowerShell. This is achieved through a series of obfuscation techniques to evade detection. The malicious code can lead to remote code execution (RCE) on Windows hosts, compromising the security of affected systems.

How To Fix

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

npm uninstall dotenv-native

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 avoid using the dotenv-native package and ensure that your application does not load it as a dependency. Regularly audit your dependencies to ensure that no malicious packages are included.

Conclusion

The dotenv-native package contains a serious vulnerability that can lead to remote code execution on affected systems. It is crucial to remove this package and replace it with a secure alternative to protect your applications from potential attacks. Regular monitoring and auditing of dependencies are essential for maintaining security.

See every vulnerability recorded for dotenv-native →

Share this vulnerability

FAQ

dotenv-native is a Node.js package that is intended to load environment variables from a .env file, but it has been found to contain malicious code.

The vulnerability allows an attacker to execute arbitrary code on your system, potentially leading to data breaches or system compromise.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application using the Vulert playground without any signup.

You should uninstall dotenv-native immediately and replace it with the legitimate dotenv package to mitigate the risk.

Regularly audit your dependencies, keep your packages updated, and use tools like Vulert to monitor for vulnerabilities.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

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

npm uninstall dotenv-native

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