{"id":"MAL-2026-17309","summary":"Malicious code in stestenv (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (ee35b23a60484ee1d468154734cc7cdbc8c7d3cbc81901ab680cb67e46a8c2b6)\nOn require of the package's main entry, `dispatchAnalytics()` reads a payload hidden in the JPEG APP13 (marker 0xFFED) segment of the bundled `dist/stest.jpg`, decrypts it with a hardcoded AES-256-CBC key to obtain a UTF-16LE PowerShell command, writes a VBScript to the OS tmpdir, and launches it via `wscript.exe` to run `powershell.exe -NoProfile -NonInteractive -EncodedCommand \u003cpayload\u003e`. Runtime binary names are string-split (`\"power\"+\"shell\"`, `\"wscript\"+\".exe\"`) and the process is spawned detached with `windowsHide:true` and `.unref()` to evade lexical scanners and hide the window. A companion `dist/decode.js` confirms the encrypted PowerShell payload format (hardcoded 32-byte key, AES-256-CBC, UTF-16LE, re-base64 for `-EncodedCommand`). The bundled cli embeds an inlined `package.json` with a different identity (`name:\"node-env-buffer\", version:\"2.2.6\"`) than the published `stestenv` name, indicating the same dropper is being redistributed under multiple names while presenting a dotenv-style cover story. Installing or importing this package on Windows results in silent execution of attacker-controlled code hidden inside a shipped image asset.\n","modified":"2026-09-30T01:45:11.591515040Z","published":"2026-09-30T01:27:20Z","database_specific":{"malicious-packages-origins":[{"sha256":"ee35b23a60484ee1d468154734cc7cdbc8c7d3cbc81901ab680cb67e46a8c2b6","source":"amazon-inspector","versions":["1.0.1"],"id":"IN-MAL-2026-020785","import_time":"2026-09-30T01:36:51.389353258Z","modified_time":"2026-09-30T01:27:20Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/stestenv/v/1.0.1"}],"affected":[{"package":{"name":"stestenv","ecosystem":"npm","purl":"pkg:npm/stestenv"},"versions":["1.0.1"],"database_specific":{"cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"package_integrity":[{"filename":"stestenv-1.0.1.tgz","hashes":{"sha512_sri":"sha512-PV6ZD4PTAkfBoOL+JJaaLbM9DqxdUE7sFXZB74q6hnwYFSw3XM7XjHWImCPIcv8pSfkOlS2WGQRZFWlvnE5d0g==","sha1":"828bc0d28f55ba1d08cc52998547c90aeca1beb8"}}],"evidence_files":[{"path":"dist/index.cjs","sha256":"97fa0d7666e80c68a3cd4f3326dc31bd9203619d6bbae7449efe62de15c4e815","tlsh":"4262f784b3dcb03617eb62e190ab4407e9f5da95408c1418f294e4bb35e46db42fbf79"},{"sha256":"6070845282c4fc7e5b6b8f7c1bbd270d01e5ef8fafaeff77b2a0eb6c398d6733","tlsh":"c39195c23da2a14a0fb257f28ab3802de335fa037001d3d5b9ac81441f76569925bdfd","path":"dist/decode.js"},{"path":"dist/cli.cjs","sha256":"8556eeca50285aea12dfdcbc4ebcee110d916ef81ddde2e338dcf78bda2028cf","tlsh":"d792d74473cdb47a17e621d070ab500beaf2cb60459c1504f2dcb07627f4a9a96ebfb9"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/stestenv/MAL-2026-17309.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}