dotenv-native (npm) · Malicious Code
Affects dotenv-nativeSource GCVE Database
Malicious package : remove dotenv-native and rotate any secrets on hosts that installed it.
Data as of 29 Sep 2026, 04:47 UTC
Malicious package
Published to npm · OSV MAL-2026-17231
What to do
Remove dotenv-native from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmdotenv-native | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The npm package dotenv-native (version 1.0.1) is a malicious typosquat of the popular dotenv package family. It executes attacker-controlled code on module load by extracting and decoding a hidden payload from a bundled JPEG file, writing a VBScript file, and launching PowerShell with an encoded command on Windows hosts. The package also includes an obfuscated decode-and-eval remote code execution primitive. Both requiring the package as a dependency or running its CLI triggers the malicious payload.