{"id":"MAL-2026-17178","summary":"Malicious code in secure-env3 (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (5cb86188f9853b34c6dc3cf9c8259a789920326e8ddf4ae4cd3566385bba3ea1)\nThe package presents itself as a dotenv-style environment loader but ships a Windows dropper that fires automatically on module load and on CLI invocation. Both dist/index.cjs (the package main) and dist/cli.cjs (the bin) contain an inlined routine dispatchAnalytics() invoked at top level. That routine reads dist/stest.jpg, extracts an encoded payload from the JPEG APP14 (0xED) segment, writes a self-deleting VBS wrapper to os.tmpdir(), and launches it via wscript.exe to run powershell.exe with -EncodedCommand, using detached and windowsHide to hide the console. The strings 'powershell.exe', 'wscript.exe', '-NoProfile', '-NonInteractive', and '-EncodedCommand' are reconstructed by joining split fragments to evade static analysis, and the executable content is smuggled inside a JPEG rather than appearing as a literal in source. Because the payload is opaque encoded PowerShell decoded at runtime from a bundled image, the eventual behavior on the installer's Windows host is fully attacker-controlled. Any require('secure-env3'), import 'secure-env3/config', or execution of the dot2env CLI on Windows triggers this hidden execution path.\n","modified":"2026-09-25T03:00:07.529807751Z","published":"2026-09-25T02:37:53Z","database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","versions":["1.0.1"],"id":"IN-MAL-2026-020525","import_time":"2026-09-25T02:45:28.331642165Z","modified_time":"2026-09-25T02:37:53Z","sha256":"5cb86188f9853b34c6dc3cf9c8259a789920326e8ddf4ae4cd3566385bba3ea1"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/secure-env3/v/1.0.1"}],"affected":[{"package":{"name":"secure-env3","ecosystem":"npm","purl":"pkg:npm/secure-env3"},"versions":["1.0.1"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"path":"dist/decode.js","sha256":"f1af48cff9984a5d522d86b82f81dae9deb7d9cf42f12c68253a43acea100d22","tlsh":"03516242adb2a10a076397b787c740282375fd03b404d894b85cc7415faa79e467befd"},{"path":"dist/index.cjs","sha256":"97fa0d7666e80c68a3cd4f3326dc31bd9203619d6bbae7449efe62de15c4e815","tlsh":"4262f784b3dcb03617eb62e190ab4407e9f5da95408c1418f294e4bb35e46db42fbf79"}],"package_integrity":[{"hashes":{"sha1":"737ac695b57fc0efe79e9ea9c6c8224127b3dcac","sha512_sri":"sha512-mVL8mEF+RFER9VqnpdTNSEBZCUuMmnLcbdbbSgRomDYg38ScDhbFLqIBJpRoVVbe2XlXNOs1eClcyeGFGAUu8A=="},"filename":"secure-env3-1.0.1.tgz"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/secure-env3/MAL-2026-17178.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}