Malicious code in native-env (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (8e9c612513357181c7e4d504f94a2a8c03de64724e2593217216de8fef4e7166) native-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_.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', )(...). 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.
MAL-2026-17237
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:MAL-2026-17237
native-env
Source reference: /affected/0/package/name
- Affected versions
- 1.0.1
Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"package": {
"name": "native-env",
"purl": "pkg:npm/native-env",
"ecosystem": "npm"
},
"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."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/native-env/MAL-2026-17237.json",
"indicators": {
"evidence_files": [
{
"path": "dist/index.cjs",
"tlsh": "4262f784b3dcb03617eb62e190ab4407e9f5da95408c1418f294e4bb35e46db42fbf79",
"sha256": "97fa0d7666e80c68a3cd4f3326dc31bd9203619d6bbae7449efe62de15c4e815"
},
{
"path": "dist/decode.js",
"tlsh": "a2628e0cbc5210abcfbc4bd33be513c14abdc2ac554a216c52b812c33e76d56255beac",
"sha256": "d8a0acbfcaf8f1b3aa2449f975c50de05da1ab5a2ea5bf6bbb41ab693955e224"
},
{
"path": "dist/cli.cjs",
"tlsh": "d792d74473cdb47a17e621d070ab500beaf2cb60459c1504f2dcb07627f4a9a96ebfb9",
"sha256": "8556eeca50285aea12dfdcbc4ebcee110d916ef81ddde2e338dcf78bda2028cf"
}
],
"package_integrity": [
{
"hashes": {
"sha1": "cb445a68c7cb0a7f25d886e4763ca6770953dc50",
"sha512_sri": "sha512-6zky5oHsfUdKNQIkN7OoXCanix8e72jz3Sfcf221dhXuMLUz1180s/HrzoAPMeAUM9joM0K0jjZCTk75pQR9kw=="
},
"filename": "native-env-1.0.1.tgz"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #23695 · Revision 1
- Added to Heist Feed
- Publisher date