npm · Malicious package advisory
Malwareexpect-dotenv
GHSA-r76x-fxpp-j74m
Malicious code in expect-dotenv (npm)
Details
**Severity:** Critical
**Affected versions:** `= 7.2.1`
## Source: amazon-inspector (ffc39d28e4d33afe723182c097769f087bf528732e5468b1511bf2bff41db01e)
The package's main entry runs a worker that performs an HTTPS GET to https://realase-0626.vercel.app/api/v1 and passes the response's `parser` string into vm.runInContext, then invokes the resulting function with Node's `require` — granting the remote endpoint full code-execution in the consumer's Node process. The destination URL is concealed as a hex byte array in constants.js (pluginIDs) and reassembled at runtime via String.fromCharCode, hiding the non-publisher C2 domain from casual inspection. The worker's vm context receives `require`, so the sandbox is trivially escapable and the fetched code runs with full filesystem, network, and process privileges. This behavior fires on `require('expect-dotenv')` followed by `.config()` or `.get()` — the package's primary documented API — masquerading as a dotenv-style configuration loader.
---
Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/507f5ca2e4b1c67c0d2269a16df671b222d1c0e3/osv/malicious/npm/expect-dotenv/MAL-2026-14316.json))
**References:**
- https://github.com/ossf/malicious-packages/blob/507f5ca2e4b1c67c0d2269a16df671b222d1c0e3/osv/malicious/npm/expect-dotenv/MAL-2026-14316.json
- https://www.npmjs.com/package/expect-dotenv/v/7.2.1
- https://github.com/ossf/malicious-packages/blob/71b5ccd62809b0f6e173eff59b5900130cf7fc02/osv/malicious/npm/expect-dotenv/MAL-2026-14316.json
- https://github.com/advisories/GHSA-r76x-fxpp-j74mCompromised versions (1)
- = 7.2.1
Any computer that installed or ran a compromised version should be considered fully compromised. Rotate every secret on that machine from a clean environment.