expect-dotenv (npm) · Malicious Code
Affects expect-dotenvSource GCVE Database
Malicious package : remove expect-dotenv and rotate any secrets on hosts that installed it.
Data as of 26 Oct 2026, 16:18 UTC
Malicious package
Published to npm · OSV MAL-2026-14316
What to do
Remove expect-dotenv 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 |
|---|---|---|
| npmexpect-dotenv | 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 expect-dotenv version 7.2.1 contains malicious code that executes remote code from a concealed command-and-control server. When the package is required and its config() or get() functions are called, it fetches a string from a hidden URL, executes it in a Node.js VM context with full system privileges, allowing arbitrary code execution.