Malicious code in stestenv (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (ee35b23a60484ee1d468154734cc7cdbc8c7d3cbc81901ab680cb67e46a8c2b6) On 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 `. 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.
MAL-2026-17309
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-17309
stestenv
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": "stestenv",
"purl": "pkg:npm/stestenv",
"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/stestenv/MAL-2026-17309.json",
"indicators": {
"evidence_files": [
{
"path": "dist/index.cjs",
"tlsh": "4262f784b3dcb03617eb62e190ab4407e9f5da95408c1418f294e4bb35e46db42fbf79",
"sha256": "97fa0d7666e80c68a3cd4f3326dc31bd9203619d6bbae7449efe62de15c4e815"
},
{
"path": "dist/decode.js",
"tlsh": "c39195c23da2a14a0fb257f28ab3802de335fa037001d3d5b9ac81441f76569925bdfd",
"sha256": "6070845282c4fc7e5b6b8f7c1bbd270d01e5ef8fafaeff77b2a0eb6c398d6733"
},
{
"path": "dist/cli.cjs",
"tlsh": "d792d74473cdb47a17e621d070ab500beaf2cb60459c1504f2dcb07627f4a9a96ebfb9",
"sha256": "8556eeca50285aea12dfdcbc4ebcee110d916ef81ddde2e338dcf78bda2028cf"
}
],
"package_integrity": [
{
"hashes": {
"sha1": "828bc0d28f55ba1d08cc52998547c90aeca1beb8",
"sha512_sri": "sha512-PV6ZD4PTAkfBoOL+JJaaLbM9DqxdUE7sFXZB74q6hnwYFSw3XM7XjHWImCPIcv8pSfkOlS2WGQRZFWlvnE5d0g=="
},
"filename": "stestenv-1.0.1.tgz"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #33439 · Revision 1
- Added to Heist Feed
- Publisher date