Malicious code in expect-dotenv (npm)
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.
AI Analysis
Technical Summary
The expect-dotenv package (npm) version 7.2.1 includes a worker that performs an HTTPS GET request to a concealed remote endpoint (https://realase-0626.vercel.app/api/v1). The response's 'parser' string is executed via vm.runInContext with Node's require function passed in, enabling the remote code to run with full filesystem, network, and process privileges. The URL is obfuscated as a hex byte array and reassembled at runtime to hide the malicious command-and-control domain. This behavior triggers when the package is imported and its primary documented API methods .config() or .get() are invoked, masquerading as a legitimate dotenv configuration loader while executing arbitrary code.
Potential Impact
This malicious code allows an attacker controlling the remote endpoint to execute arbitrary code within the victim's Node.js process with full privileges, potentially leading to complete system compromise, data theft, or further malware deployment. The obfuscation of the C2 domain and execution within a VM context makes detection more difficult.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately stop using expect-dotenv version 7.2.1 and remove it from their projects. Verify dependencies for malicious packages and replace expect-dotenv with a trusted dotenv loader. Monitor for any unusual activity related to this package. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for updates.
Malicious code in expect-dotenv (npm)
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.
Affected software
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
Technical Analysis
The expect-dotenv package (npm) version 7.2.1 includes a worker that performs an HTTPS GET request to a concealed remote endpoint (https://realase-0626.vercel.app/api/v1). The response's 'parser' string is executed via vm.runInContext with Node's require function passed in, enabling the remote code to run with full filesystem, network, and process privileges. The URL is obfuscated as a hex byte array and reassembled at runtime to hide the malicious command-and-control domain. This behavior triggers when the package is imported and its primary documented API methods .config() or .get() are invoked, masquerading as a legitimate dotenv configuration loader while executing arbitrary code.
Potential Impact
This malicious code allows an attacker controlling the remote endpoint to execute arbitrary code within the victim's Node.js process with full privileges, potentially leading to complete system compromise, data theft, or further malware deployment. The obfuscation of the C2 domain and execution within a VM context makes detection more difficult.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately stop using expect-dotenv version 7.2.1 and remove it from their projects. Verify dependencies for malicious packages and replace expect-dotenv with a trusted dotenv loader. Monitor for any unusual activity related to this package. Patch status is not yet confirmed — check the vendor advisory or npm security advisories for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14316
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a870a74acd9273b49b58ad2
Added to database: 08/20/2026, 14:08:52 UTC
Last enriched: 08/20/2026, 14:31:46 UTC
Last updated: 08/20/2026, 14:31:46 UTC
Views: 2
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.
External Links
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.