Skip to main content

Malicious code in dotenv-express (npm)

0
Critical
Published: 03/24/2026 (03/24/2026, 15:43:15 UTC)
Source: GCVE Database
Product: dotenv-express

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

dotenv-express
pkg:npm/dotenv-express
Affected versions
=2.5.5=17.4.4=17.4.5=17.4.3=17.4.6=17.4.2

Run 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

AILast updated: 09/12/2026, 20:32:02 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses