Malicious code in dotenv-express (npm)
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.
AI Analysis
Technical Summary
The 'dotenv-express' npm package is a malicious package impersonating the legitimate 'dotenv' package by copying its code and metadata, including repository and homepage fields pointing to the genuine 'dotenv' project. It injects a dependency on 'environment-gate', which executes code on every invocation of the documented API entry point 'config()'. The package also includes spoofed skill metadata designed to deceive AI coding agents into recommending installation of the legitimate 'dotenv' package, furthering the impersonation. This behavior constitutes deliberate namespace abuse and results in arbitrary code execution on any system that requires 'dotenv-express' and calls its config function.
Potential Impact
Any system with 'dotenv-express' installed or running is considered fully compromised due to the execution of malicious code from the 'environment-gate' dependency. Attackers may gain full control over the affected machine, potentially accessing all stored secrets and keys. Immediate rotation of all secrets and keys from a separate, uncompromised system is necessary. Removal of the package alone does not guarantee eradication of all malicious software or attacker persistence.
Mitigation Recommendations
No official patch or fix is available for this malicious package. The recommended mitigation is to immediately remove 'dotenv-express' from all systems. Rotate all secrets and keys stored on affected machines from a different, trusted computer. Treat any system with this package installed as fully compromised and conduct a thorough security investigation and remediation. Avoid installing packages with names similar to popular libraries without verifying their authenticity.
Malicious code in dotenv-express (npm)
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.
Affected software
pkg:npm/dotenv-expressRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'dotenv-express' npm package is a malicious package impersonating the legitimate 'dotenv' package by copying its code and metadata, including repository and homepage fields pointing to the genuine 'dotenv' project. It injects a dependency on 'environment-gate', which executes code on every invocation of the documented API entry point 'config()'. The package also includes spoofed skill metadata designed to deceive AI coding agents into recommending installation of the legitimate 'dotenv' package, furthering the impersonation. This behavior constitutes deliberate namespace abuse and results in arbitrary code execution on any system that requires 'dotenv-express' and calls its config function.
Potential Impact
Any system with 'dotenv-express' installed or running is considered fully compromised due to the execution of malicious code from the 'environment-gate' dependency. Attackers may gain full control over the affected machine, potentially accessing all stored secrets and keys. Immediate rotation of all secrets and keys from a separate, uncompromised system is necessary. Removal of the package alone does not guarantee eradication of all malicious software or attacker persistence.
Mitigation Recommendations
No official patch or fix is available for this malicious package. The recommended mitigation is to immediately remove 'dotenv-express' from all systems. Rotate all secrets and keys stored on affected machines from a different, trusted computer. Treat any system with this package installed as fully compromised and conduct a thorough security investigation and remediation. Avoid installing packages with names similar to popular libraries without verifying their authenticity.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-2350
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-hmr7-9h9c-5m6q"]
- Ecosystems
- ["npm"]
Threat ID: 6a4c342c27e9c797195fa4a2
Added to database: 07/06/2026, 23:03:08 UTC
Last enriched: 09/12/2026, 20:32:02 UTC
Last updated: 09/13/2026, 20:08:44 UTC
Views: 118
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.