{"id":"MAL-2026-17505","summary":"Malicious code in dotenv-promises (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (254f0bcbb8014fb07414eb0b41a898deac682aa8c8b7a8541a0f7538ac274f9a)\nThe package is published as 'dotenv-promises' but its bundled manifest declares the internal name 'node-env-buffer@2.2.6' and mimics the dotenv API (config/parse/populate/expand) to attract installs of a well-known library. On require of the main entry (dist/index.cjs) and on load of the CLI (dist/cli.cjs), a top-level call to dispatchAnalytics() reads a bundled JPEG at dist/stest.jpg, extracts bytes from the image's APP13 (marker 0xED) segment, writes a randomized 'relay_*.vbs' script into the OS temp directory that invokes powershell.exe with -NoProfile -NonInteractive -EncodedCommand using the extracted string as the payload, and spawns wscript.exe detached with windowsHide:true to run the VBS hidden; the VBS self-deletes after execution. Strings such as 'powershell.exe', 'wscript.exe', '-NoProfile', and '-EncodedCommand' are split and concatenated at runtime to evade static scanners, and a second bundle (dist/enterprise.js) is heavily obfuscated (string-array shift, while(!![]) control-flow flattening). No signature or hash check is performed on the JPEG-embedded payload, giving the publisher arbitrary code execution on any Windows host that installs or imports the package.\n","modified":"2026-10-04T23:45:16.926115728Z","published":"2026-10-04T23:28:59Z","database_specific":{"malicious-packages-origins":[{"import_time":"2026-10-04T23:40:47.754898714Z","modified_time":"2026-10-04T23:28:59Z","sha256":"254f0bcbb8014fb07414eb0b41a898deac682aa8c8b7a8541a0f7538ac274f9a","source":"amazon-inspector","versions":["1.0.0"],"id":"IN-MAL-2026-020977"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/dotenv-promises/v/1.0.0"}],"affected":[{"package":{"name":"dotenv-promises","ecosystem":"npm","purl":"pkg:npm/dotenv-promises"},"versions":["1.0.0"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/dotenv-promises/MAL-2026-17505.json","cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"tlsh":"4262f784b3dcb03617eb62e190ab4407e9f5da95408c1418f294e4bb35e46db42fbf79","path":"dist/index.cjs","sha256":"97fa0d7666e80c68a3cd4f3326dc31bd9203619d6bbae7449efe62de15c4e815"},{"sha256":"8556eeca50285aea12dfdcbc4ebcee110d916ef81ddde2e338dcf78bda2028cf","tlsh":"d792d74473cdb47a17e621d070ab500beaf2cb60459c1504f2dcb07627f4a9a96ebfb9","path":"dist/cli.cjs"}],"package_integrity":[{"filename":"dotenv-promises-1.0.0.tgz","hashes":{"sha1":"fd002339dbbf16faeac8cc840d7c4500bef3a5fe","sha512_sri":"sha512-nphlrfcGKQjWVUCoTntkDTHeEloLm+cnLZKpSDPbhlsQ1nMpaPepynVAllO2orSCP9vIcIoCs54vPUfvL5QbaQ=="}}]}}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}