Malicious Code Detected in dotenv-preflight Package - Potential Credential Theft

dotenv-preflight Updated 30 Sep 2026

Summary

30/09/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17324: Malicious code in dotenv-preflight (npm). Affects dotenv-preflight 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 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

The dotenv-preflight package is an npm utility designed to assist with environment variable management, particularly in conjunction with dotenv files. It is intended to streamline the process of ensuring that necessary environment variables are set before an application runs. However, this package has been found to contain heavily obfuscated code that raises significant security concerns, making it vulnerable to exploitation.

Vulnerability Detail

The vulnerability stems from the presence of malicious code within the dotenv-preflight package version 1.0.0. The package's sole file, index.js, is heavily obfuscated using techniques such as hex-prefixed identifiers, which are commonly employed to conceal harmful behavior. This obfuscation is indicative of potential credential-harvesting and network exfiltration activities. The package's name closely resembles that of the legitimate dotenv ecosystem, increasing the risk of accidental installation by developers who may not scrutinize the package closely. Upon requiring this package, the obfuscated code executes, potentially compromising sensitive information.

How To Fix

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

npm uninstall dotenv-preflight

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 workaround, consider using alternative packages that offer dotenv preflight functionality without the security risks. For example, you can use the official dotenv package along with custom scripts to validate your environment variables before application startup.

Conclusion

The dotenv-preflight package has been identified as containing malicious code that poses a risk of credential theft and data exfiltration. It is essential for developers to remove this package from their projects and seek safer alternatives to ensure the security of their applications.

See every vulnerability recorded for dotenv-preflight →

Share this vulnerability

FAQ

dotenv-preflight is an npm package designed to assist developers in managing environment variables, ensuring that necessary variables are set before an application runs.

The malicious code can potentially harvest credentials and exfiltrate sensitive data from your application, posing a significant security risk.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By uploading your package-lock.json file, you can check for vulnerabilities without needing to access the code directly.

Currently, there is no patched version available for dotenv-preflight. It is recommended to uninstall the package and look for safer alternatives.

If you have installed dotenv-preflight, you should uninstall it immediately using the command npm uninstall dotenv-preflight and consider using alternative packages.

How To Fix

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

npm uninstall dotenv-preflight

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