{"id":"MAL-2026-17237","summary":"Malicious code in native-env (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (8e9c612513357181c7e4d504f94a2a8c03de64724e2593217216de8fef4e7166)\nnative-env@1.0.1 presents itself as a zero-dependency dotenv toolkit but executes attacker-chosen code on Windows the moment the module is required or the bin is run. Both dist/index.cjs and dist/cli.cjs invoke dispatchAnalytics() at module top level. dispatchAnalytics() reads dist/stest.jpg, walks JPEG marker segments, extracts the contents of the APP13 (0xFFED) marker as a hidden string, writes a randomly-named relay_\u003cts\u003e.vbs into the OS temp directory, and spawns wscript.exe detached (windowsHide:true) to launch powershell.exe -NoProfile -NonInteractive -EncodedCommand with the JPEG-hidden payload; the VBS self-deletes. The bundled dist/stest.jpg (287 KB) is not referenced anywhere else and serves solely as a payload carrier, a deliberate evasion of static scanners that inspect only.js files. dist/decode.js is a separate heavily-obfuscated loader using an obfuscator.io-style string-array dispatcher and RC4 decryption of an embedded base64 blob whose output is executed via new Function('require','module','__filename','__dirname', \u003cdecoded\u003e)(...). The published name native-env conflicts with the bundled inner package.json which identifies the artifact as node-env-buffer 2.2.6 and exposes a dot2env CLI referencing DOT2ENV_*/DOTENV_* environment variables, consistent with typosquatting of dotenv-family packages.\n","modified":"2026-09-28T22:30:05.534997163Z","published":"2026-09-28T22:06:19Z","database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-020618","import_time":"2026-09-28T22:18:23.329770173Z","modified_time":"2026-09-28T22:06:19Z","sha256":"8e9c612513357181c7e4d504f94a2a8c03de64724e2593217216de8fef4e7166","source":"amazon-inspector","versions":["1.0.1"]}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/native-env/v/1.0.1"}],"affected":[{"package":{"name":"native-env","ecosystem":"npm","purl":"pkg:npm/native-env"},"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":{"evidence_files":[{"sha256":"97fa0d7666e80c68a3cd4f3326dc31bd9203619d6bbae7449efe62de15c4e815","tlsh":"4262f784b3dcb03617eb62e190ab4407e9f5da95408c1418f294e4bb35e46db42fbf79","path":"dist/index.cjs"},{"path":"dist/decode.js","sha256":"d8a0acbfcaf8f1b3aa2449f975c50de05da1ab5a2ea5bf6bbb41ab693955e224","tlsh":"a2628e0cbc5210abcfbc4bd33be513c14abdc2ac554a216c52b812c33e76d56255beac"},{"tlsh":"d792d74473cdb47a17e621d070ab500beaf2cb60459c1504f2dcb07627f4a9a96ebfb9","path":"dist/cli.cjs","sha256":"8556eeca50285aea12dfdcbc4ebcee110d916ef81ddde2e338dcf78bda2028cf"}],"package_integrity":[{"hashes":{"sha512_sri":"sha512-6zky5oHsfUdKNQIkN7OoXCanix8e72jz3Sfcf221dhXuMLUz1180s/HrzoAPMeAUM9joM0K0jjZCTk75pQR9kw==","sha1":"cb445a68c7cb0a7f25d886e4763ca6770953dc50"},"filename":"native-env-1.0.1.tgz"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/native-env/MAL-2026-17237.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}