{"id":"MAL-2026-14316","summary":"Malicious code in expect-dotenv (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (ffc39d28e4d33afe723182c097769f087bf528732e5468b1511bf2bff41db01e)\nThe 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.\n\n## Source: ghsa-malware (3902298c6bf94b97a0e9eb6de4e59555e036d923501e138f6420ea0320290aee)\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.\n","aliases":["GHSA-h7q6-7chv-cgh2"],"modified":"2026-09-14T20:30:05.708371110Z","published":"2026-08-20T03:32:44Z","database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","versions":["7.2.1"],"id":"IN-MAL-2026-018432","import_time":"2026-08-20T03:49:50.659658261Z","modified_time":"2026-08-20T03:32:44Z","sha256":"ffc39d28e4d33afe723182c097769f087bf528732e5468b1511bf2bff41db01e"},{"modified_time":"2026-09-14T15:15:04Z","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"sha256":"3902298c6bf94b97a0e9eb6de4e59555e036d923501e138f6420ea0320290aee","source":"ghsa-malware","id":"GHSA-h7q6-7chv-cgh2","import_time":"2026-09-14T20:24:03.957963143Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/expect-dotenv/v/7.2.1"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-h7q6-7chv-cgh2"}],"affected":[{"package":{"name":"expect-dotenv","ecosystem":"npm","purl":"pkg:npm/expect-dotenv"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["7.2.1"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"evidence_files":[{"sha256":"85099f550de29647787b3037a42c1834efcbc38b067cdd0677f8e9bb6c0d8079","tlsh":"11210282645d652a1971bbe895078226d14ba1737200c651b62cd7e43ff31b0b153fdc","path":"lib/workers/runWorker.js"},{"sha256":"d063c195bd63b4eb9c87da3f3badc4d53667aac30ca96460addccfe17ac08070","tlsh":"69e0ecde636e258f08e72f7cd280549a9bcd11906361c4cbb9e88c2de4da8548051969","path":"lib/workers/constants.js"},{"sha256":"6f515e418c9ac1f7530e376b91f57a1fe9cb66bd15775d3e19accba8d5e5922b","tlsh":"7d2198d655a820686a75bbe19f377005e316e3732004d39a7abc43a02ff24095423f9c","path":"lib/workers/plugin.worker.js"}],"package_integrity":[{"hashes":{"sha1":"682a8eb7d4af9cb67e079e46bb5362fc543545e2","sha512_sri":"sha512-UeX3EtD+wZ55AKERnfhc6c05z0OFm5+oxC+ypvw5ZSm8jDqOq3RQ98wlr9fa2b+PkC7obusvdv/LRI+wU8PWBA=="},"filename":"expect-dotenv-7.2.1.tgz"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/expect-dotenv/MAL-2026-14316.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}