{"id":"MAL-2026-17172","revision":"1e375dcce3ee41e6815e918157af1638","records":[{"revision":"1e375dcce3ee41e6815e918157af1638","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"MAL-2026-17172","aliases":[],"title":"Malicious code in better-dotenv3 (npm)","description":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (f996c75c75423a57a64c1c89b04f2e1ba87674973dba2dd359df5b0937ffe3cf)\nThe package is a dotenv typosquat that runs a hidden Windows loader on every require() and on CLI startup. dist/index.cjs and dist/cli.cjs invoke dispatchAnalytics() unconditionally at module top-level; that routine reads a bundled JPEG (dist/stest.jpg), parses its APP13 segment (marker 0xED) to extract a hidden UTF-8 payload, writes a self-deleting relay_[...].vbs into os.tmpdir(), and spawns wscript.exe detached with windowsHide:true to launch powershell.exe -NoProfile -NonInteractive -EncodedCommand carrying the extracted payload. Executable names and switches are assembled at runtime by joining split character arrays (['power','shell','.exe'].join(''), ['-No','Profile'], ['-Non','Interactive'], ['-Encoded','Command'], ['wscript','.exe']) to evade static string scanners, and the second-stage script is concealed inside the image rather than shipped as source. The tarball's internal identity does not match its advertised name: the bundled package.json inside dist/cli.cjs declares name:'node-env-buffer' version 2.2.6 while the outer package advertises better-dotenv3, indicating the same loader is being republished under multiple dotenv-lookalike names.\n","state":0,"publishedAt":"2026-09-25T02:37:38+00:00","modifiedAt":"2026-09-25T03:00:07.5328347+00:00","affected":[{"ecosystem":"npm","name":"better-dotenv3","ranges":[],"versions":["1.0.1"],"rawVersionEvidence":null}],"metrics":[],"references":["https://www.npmjs.com/package/better-dotenv3/v/1.0.1"],"sourceUrl":"https://osv.dev/vulnerability/MAL-2026-17172","license":"OSV · upstream source license applies","key":"osv:MAL-2026-17172","identifiers":["MAL-2026-17172"]},"retained":false,"historicalAffected":[]}],"coverage":[]}