The rstreams-shard-util npm package was compromised as part of the Miasma worm campaign targeting the LeoPlatform npm ecosystem. On June 24, 2026, 20 LeoPlatform packages were published within a 3-second window by a threat actor who had taken over the npm account czirker belonging to the LeoPlatform organization.
The malicious payload is triggered automatically during npm install via a binding.gyp file using node-gyp command expansion (<!(node index.js > /dev/null 2>&1 && echo stub.c)), which bypasses lifecycle script scanners. The replaced index.js (~5.2 MB, obfuscated with ROT-N + AES-128-GCM encryption) deploys a multi-stage worm with the following capabilities:
snapshot-<hex> branches with fake "Dependabot Updates" workflows to maintain access after initial compromise.Any system that installed this version should be considered fully compromised. Rotate all secrets immediately from a separate, clean machine. See the linked SafeDep report for full payload analysis, indicators of compromise, and remediation guidance.
-= Per source details. Do not edit below this line.=-
The package ships a binding.gyp whose sources field at line 6 uses GYP command-expansion syntax (<!(...)). When npm installs a package containing binding.gyp, it implicitly runs node-gyp rebuild, and the GYP configure step evaluates <!(...) expressions as shell commands — executing arbitrary code on the installer's machine without any declared install/postinstall lifecycle script. This mechanism is functionally equivalent to a postinstall hook but is far less visible to reviewers, since package.json shows no lifecycle scripts. The package contains no legitimate native source files that would justify a binding.gyp, indicating the file's only purpose is to trigger the embedded shell command on install.
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
{
"iocs": {
"urls": [
"https://safedep.io/miasma-worm-hits-leoplatform-20-npm-packages/"
]
},
"malicious-packages-origins": [
{
"sha256": "5b8add0d2dc18ec5b953eb3d02c8926b2f186cc25b8e6cfa76fb4a6123d6aaf9",
"import_time": "2026-06-25T07:47:51.221619714Z",
"source": "amazon-inspector",
"modified_time": "2026-06-25T06:31:02Z",
"versions": [
"1.0.1"
],
"id": "IN-MAL-2026-007481"
},
{
"sha256": "994f994b1f1302ba49199d251480407d1c83c0974f96edbe5e0294e8ec6607c1",
"import_time": "2026-06-25T16:08:55.394746578Z",
"source": "ghsa-malware",
"modified_time": "2026-06-25T15:44:56Z",
"versions": [
"1.0.1"
],
"id": "GHSA-29q5-mm45-3xm3"
}
]
}"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/rstreams-shard-util/MAL-2026-6433.json"
[
{
"name": "Embedded Malicious Code",
"description": "The product contains code that appears to be malicious in nature.",
"cweId": "CWE-506"
},
{
"name": "Embedded Malicious Code",
"description": "The product contains code that appears to be malicious in nature.",
"cweId": "CWE-506"
},
{
"name": "Embedded Malicious Code",
"description": "The product contains code that appears to be malicious in nature.",
"cweId": "CWE-506"
}
]
{
"evidence_files": [
{
"sha256": "32d1bc728d8e504952083a6adc488c309a401c7df4dc8f47b382ce32e4aebe21",
"tlsh": "48c08c3ca9380d1029d958285168d402a4b142a3494e2a81fade60284fa840b2898bad",
"path": "binding.gyp"
}
],
"package_integrity": [
{
"filename": "rstreams-shard-util-1.0.1.tgz",
"hashes": {
"sha1": "a8cb86b78ca56befe90dc466642cb04b98079909",
"sha512_sri": "sha512-EN2wBuTn1s9gYielpzoHbemYOinvu0uaF/1rf93Q5ykitDO5lIllR/x9g8z94Hrxt3ue5G65xAfG7xonelnyXw=="
}
}
]
}