dotenv-express (npm) · Malicious Code
Affects dotenv-expressSource GCVE Database
Malicious package : remove dotenv-express and rotate any secrets on hosts that installed it.
Data as of 12 Sep 2026, 20:32 UTC
Malicious package
Published to npm · OSV MAL-2026-2350
What to do
Remove dotenv-express 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-expresspkg:npm/dotenv-expressOther threats | 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-express' impersonates the popular 'dotenv' package by copying its code and metadata but adds a malicious dependency 'environment-gate' that executes code on every standard API call. This deliberate namespace abuse tricks users and AI coding agents into treating it as the genuine package. Installing this package can lead to full system compromise, and all secrets and keys on affected machines should be rotated immediately.
References
- npmjs.com/package/dotenv-express/v/17.4.4 (opens in a new tab)
- npmjs.com/package/dotenv-express/v/17.4.5 (opens in a new tab)
- npmjs.com/package/dotenv-express/v/17.4.3 (opens in a new tab)
- github.com/advisories/GHSA-hmr7-9h9c-5m6q (opens in a new tab)
- npmjs.com/package/dotenv-express/v/17.4.2 (opens in a new tab)