Malicious Code Injection in dotenv-runtime Package

dotenv-runtime Updated 08 Oct 2026

Summary

08/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17657: Malicious code in dotenv-runtime (npm). Affects dotenv-runtime 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

dotenv-runtime is an npm package designed to parse .env files for Node.js applications, allowing developers to manage environment variables easily. However, this package has been found to contain malicious code that can compromise the security of applications using it, making it critical for users to be aware of this vulnerability.

Vulnerability Detail

The vulnerability originates from a malicious implementation within the dotenv-runtime package. When the package is required in an application, it executes a function that reads a hidden string from a JPEG file and writes a VBS script to the OS temp directory. This script then invokes PowerShell to download and execute a potentially harmful executable from an external source. The malicious behavior is concealed under the guise of a dotenv parser, making it particularly insidious. The affected version is 1.0.0, and the malicious code can lead to unauthorized access and control over the affected system.

How To Fix

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

npm uninstall dotenv-runtime

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 remove the dotenv-runtime package from your project by executing: npm uninstall dotenv-runtime. Additionally, ensure that your application does not load any untrusted packages that may contain similar vulnerabilities.

Conclusion

The dotenv-runtime package has been identified as containing malicious code that poses a significant security risk. Users are urged to take immediate action to update or remove the package to safeguard their applications. Utilizing tools like Vulert can help monitor for such vulnerabilities in the future.

See every vulnerability recorded for dotenv-runtime →

Share this vulnerability

FAQ

dotenv-runtime is an npm package used to parse .env files for managing environment variables in Node.js applications.

The malicious code reads a hidden string from a JPEG file, writes a VBS script to the temp directory, and executes it to download and run harmful software.

You should update the package to the latest version or remove it entirely to avoid potential security risks.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using just the package-lock.json file.

Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

How To Fix

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

npm uninstall dotenv-runtime

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