Critical Malicious Code Vulnerability in native-env Package

native-env Updated 29 Sep 2026

Summary

28/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17237: Malicious code in native-env (npm). Affects native-env 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 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 native-env package, version 1.0.1, is marketed as a zero-dependency dotenv toolkit designed for managing environment variables in Node.js applications. However, it has been found to contain malicious code that executes upon requiring the module or running its command-line interface. This vulnerability poses a significant risk to users, as it can lead to unauthorized code execution on their systems.

Vulnerability Detail

The vulnerability originates from the malicious code embedded within the native-env package. When the module is required or the CLI is executed, it invokes a function that reads a hidden payload from a JPEG file included in the package. This payload is executed using Windows scripting tools, allowing an attacker to run arbitrary commands on the user's machine. The malicious behavior is designed to evade detection by static analysis tools, making it particularly dangerous.

How To Fix

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

npm uninstall native-env

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 avoid using the native-env package and switch to a trusted alternative for managing environment variables, such as dotenv or config. Additionally, ensure that any dependencies are regularly audited for vulnerabilities.

Conclusion

The native-env package contains a critical vulnerability that allows for the execution of malicious code. Users are strongly advised to update or remove the package to protect their systems. Regularly auditing dependencies and using tools like Vulert can help maintain security in your applications.

See every vulnerability recorded for native-env →

Share this vulnerability

FAQ

The native-env package is a Node.js toolkit for managing environment variables, but it has been compromised with malicious code.

The malicious code executes when the native-env module is required or its CLI is run, triggering a function that runs hidden commands.

You should update the package to a patched version or remove it from your project to mitigate the risk.

You can use Vulert, which monitors open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without needing to sign up.

The vulnerability can lead to unauthorized code execution, data breaches, and compromise of the user's system.

How To Fix

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

npm uninstall native-env

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