{"id":"MAL-2026-6417","summary":"Malicious code in leo-auth (npm)","details":"The `leo-auth` 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.\n\nThe malicious payload is triggered automatically during `npm install` via a `binding.gyp` file using node-gyp command expansion (`\u003c!(node index.js \u003e /dev/null 2\u003e&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:\n\n- Credential theft: Targets npm, GitHub, PyPI, RubyGems, Kubernetes, HashiCorp Vault, AWS (IAM keys, Secrets Manager, IMDS), 1Password, JFrog Artifactory, and SSH keys.\n- AI tool targeting: Exfiltrates configuration files for Claude, Cursor, Gemini, and VS Code.\n- Worm propagation: Enumerates npm packages and auto-publishes version bumps to spread to other maintainers in the ecosystem.\n- GitHub persistence: Creates orphan `snapshot-\u003chex\u003e` branches with fake \"Dependabot Updates\" workflows to maintain access after initial compromise.\n\nAny 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.\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (6fb699267ee396f96887aa6ab8538a62ecb0d2c0401aac12942b345bbe149928)\nThe package ships a binding.gyp file containing GYP command-expansion syntax (\u003c!(...) / \u003c!@(...) / \u003c@(...)) inside its sources/targets configuration at line 6. npm implicitly runs `node-gyp rebuild` whenever a binding.gyp is present (no declared install/postinstall script is required), and the GYP configure step evaluates command-expansion expressions as shell commands. This means installing the package automatically executes the embedded command on the installer's machine before any user code runs. The package is named as an authentication helper and does not ship a real native addon source tree consistent with a legitimate build, so the only purpose of the binding.gyp file is to run the embedded shell command at install time. This is the structural fingerprint of install-time remote code execution via build-config command substitution.\n\n## Source: ghsa-malware (7000a07a785f457feaee940423297a2a22e8c23df9b46fe0c5a9c10100e49a80)\nAny 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.\n","aliases":["GHSA-x8r4-xjr9-2hhm"],"modified":"2026-06-25T16:16:23.809152812Z","published":"2026-06-24T23:04:55Z","database_specific":{"iocs":{"urls":["https://safedep.io/miasma-worm-hits-leoplatform-20-npm-packages/"]},"malicious-packages-origins":[{"sha256":"6fb699267ee396f96887aa6ab8538a62ecb0d2c0401aac12942b345bbe149928","import_time":"2026-06-25T07:47:50.485143925Z","modified_time":"2026-06-25T06:30:27Z","versions":["4.0.6"],"source":"amazon-inspector","id":"IN-MAL-2026-007466"},{"sha256":"7000a07a785f457feaee940423297a2a22e8c23df9b46fe0c5a9c10100e49a80","import_time":"2026-06-25T16:08:55.426588993Z","modified_time":"2026-06-25T15:26:17Z","versions":["4.0.6"],"source":"ghsa-malware","id":"GHSA-x8r4-xjr9-2hhm"}]},"references":[{"type":"ARTICLE","url":"https://safedep.io/miasma-worm-hits-leoplatform-20-npm-packages/"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/leo-auth/v/4.0.6"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-x8r4-xjr9-2hhm"}],"affected":[{"package":{"name":"leo-auth","ecosystem":"npm","purl":"pkg:npm/leo-auth"},"versions":["4.0.6"],"database_specific":{"indicators":{"package_integrity":[{"filename":"leo-auth-4.0.6.tgz","hashes":{"sha512_sri":"sha512-/3Kcoqj5uDvvJAK7I3SD1cgFdHoJYzYu2ps0pRGJcFRgtRzjS0S0ROctKCNUdDWDsDSyClYrKF7G39ljuMKxqQ==","sha1":"809ce3680adfdb8f0746189b68b6b5a6888a960f"}}],"evidence_files":[{"sha256":"32d1bc728d8e504952083a6adc488c309a401c7df4dc8f47b382ce32e4aebe21","tlsh":"48c08c3ca9380d1029d958285168d402a4b142a3494e2a81fade60284fa840b2898bad","path":"binding.gyp"}]},"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/leo-auth/MAL-2026-6417.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"SafeDep","contact":["https://safedep.io"],"type":"FINDER"}]}