Malicious Code Injection in better-envforge: A Stealthy Threat

better-envforge Updated 21 Sep 2026

Summary

21/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-16324: Malicious code in better-envforge (npm). Affects better-envforge versions 1.0.0. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

better-envforge is an npm package designed as a dotenv-style environment configuration toolkit, allowing developers to manage environment variables easily. However, it has been found to contain malicious code that disguises itself under a different name, node-env-buffer, leading to significant security risks for users who install and utilize this package.

Vulnerability Detail

The vulnerability originates from the better-envforge package version 1.0.0, which contains malicious code embedded within its files. When the package is required or the CLI command 'dot2env' is executed, it reads a JPEG file to extract a base64-encoded PowerShell command. This command is executed via a self-deleting VBS script that runs PowerShell with attacker-controlled commands. This poses a severe risk as any Windows host that imports this package will execute the malicious code, potentially leading to unauthorized access and control over the system.

How To Fix

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

npm uninstall better-envforge

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, avoid using the better-envforge package until a secure version is released. Consider using alternative packages for managing environment variables that do not have known vulnerabilities.

Conclusion

The better-envforge package contains a serious vulnerability that allows for the execution of malicious code on Windows systems. It is essential to remove this package and monitor your applications for vulnerabilities to maintain security. Always stay updated with the latest versions of your dependencies.

See every vulnerability recorded for better-envforge →

Share this vulnerability

FAQ

better-envforge is an npm package that provides a toolkit for managing environment variables in a dotenv-style format.

The malicious code is hidden within a JPEG file and is executed when the package is imported or the CLI command is run, leading to the execution of unauthorized PowerShell commands.

Using this package can lead to unauthorized access to your system, data breaches, and potential control by attackers over your environment.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without any signup.

If you have installed better-envforge, immediately remove it from your project and check for any signs of compromise in your system.

How To Fix

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

npm uninstall better-envforge

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