{"id":"MAL-2026-5295","summary":"Malicious code in coolbox (PyPI)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (c55bfdad112134e980af7568a9138be1e4b940f7bfbeebad2b0f85d9337a0f44)\nThe wheel installs `coolbox-setup.pth`, a Python path-configuration file that Python auto-loads at every interpreter startup (any `python` invocation system-wide, not just `import coolbox`). The.pth uses `exec()` on an obfuscated string that downloads the Bun JavaScript runtime from `https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-{platform}-{arch}.zip` to `/tmp/b/bun`, chmods it executable, and runs a glob-located `_index.js` sibling under it. A `.bun_ran` sentinel file gates one-shot execution. CoolBox is advertised as a Python genomics/Jupyter visualization library (GangCaoLab, BMC Bioinformatics 2021) and has no legitimate need to install or execute a JavaScript runtime. The release also shows hijack fingerprints: `coolbox/__init__.py` declares `__version__ = '0.4.0'` while the dist-info METADATA declares `Version: 0.4.1`, and RECORD additively references the prior `coolbox-0.4.0.dist-info/` alongside the new `coolbox-setup.pth` — consistent with a malicious republish layered on top of the legitimate prior release. The `_index.js` payload is not listed in RECORD, indicating it is staged from another source. Installer harm: any system that installs this wheel will execute attacker-controlled JavaScript under the Bun runtime on every subsequent `python` startup, with the user's privileges.\n\n## Source: kam193 (5c2dc2f03691017c67f2ef9805c4974416d935298b4748b033bfb7f487ede251)\nVersions 0.4.1, 0.4.2 were compromised.\n\n\nCompromised packages start an obfuscated infostealer. The infostealer is a heavily obfuscated JavaScript code executed using Bun runtime on Python startup. It collectes all kinds of sensitive data, including API keys, credentials to package repositories, cryptocurrency assets, password manager data. Infostealer actively queries online services to collect additional secrets as well as attempts to gain persistence and spread further by publishing infected packages using collected credentials. Data are exfiltrated likely using Github. The code seems to threaten to wipe the user's data if it detects invalid GitHub tokens. Cleanup should be done with caution.\n\nIt seems to be related to the recent Mini Shai Hulud campaign.\n\n\n---\n\nCategory: MALICIOUS - The campaign has clearly malicious intent, like infostealers.\n\n\nCampaign: 2026-06-compr-woodpecker\n\n\nReasons (based on the campaign):\n\n\n - compromised-package\n\n\n - exfiltration-env-variables\n\n\n - exfiltration-cloud-tokens\n\n\n - exfiltration-credentials\n\n\n - abuses-pth\n\n\n - obfuscation\n\n\n - infostealer\n\n\n - The package contains code to detect if it is running in a sandbox environment.\n\n\n - exfiltration-crypto\n\n\n - files-exfiltration\n\n\n - destructive-actions\n","modified":"2026-06-12T20:01:59.526486702Z","published":"2026-06-06T06:13:57Z","database_specific":{"malicious-packages-origins":[{"sha256":"5c2dc2f03691017c67f2ef9805c4974416d935298b4748b033bfb7f487ede251","source":"kam193","versions":["0.4.1","0.4.2"],"modified_time":"2026-06-06T06:13:57Z","id":"pypi/2026-06-compr-woodpecker/coolbox","import_time":"2026-06-07T15:57:34.745836928Z"},{"sha256":"f0d5fde6bb63a9bdd47ede4cdf19e54d636016848ad9e780a0db4d96138c2d6f","source":"kam193","versions":["0.4.1","0.4.2"],"modified_time":"2026-06-06T06:13:57Z","id":"pypi/2026-06-compr-woodpecker/coolbox","import_time":"2026-06-08T11:41:02.516930226Z"},{"sha256":"6120318ad0beb72f5fe01fbceb6a2bb29b2c93c277b4a5fe2b5d7f148bcd30d8","id":"pypi/2026-06-compr-woodpecker/coolbox","versions":["0.4.1","0.4.2"],"modified_time":"2026-06-07T15:36:23Z","source":"kam193","import_time":"2026-06-08T19:19:19.173271277Z"},{"sha256":"da9448cdfb3593bc9434cbc09686ea2d8bc73f5b531e45d13229949e14aadbf8","id":"pypi/2026-06-compr-woodpecker/coolbox","versions":["0.4.1","0.4.2"],"modified_time":"2026-06-07T15:36:23Z","source":"kam193","import_time":"2026-06-09T07:48:29.633986211Z"},{"sha256":"c55bfdad112134e980af7568a9138be1e4b940f7bfbeebad2b0f85d9337a0f44","source":"amazon-inspector","versions":["0.4.1"],"modified_time":"2026-06-12T19:02:16Z","id":"IN-MAL-2026-005804","import_time":"2026-06-12T19:43:35.178454373Z"}]},"references":[{"type":"WEB","url":"https://socket.dev/blog/mini-shai-hulud-campaign-hits-red-hat-cloud-services-npm-packages"},{"type":"WEB","url":"https://bad-packages.kam193.eu/pypi/campaign/2026-06-compr-woodpecker"},{"type":"WEB","url":"https://socket.dev/blog/shai-hulud-descends-to-hades-miasma-pypi-wave"},{"type":"WEB","url":"https://o3.security/blog/pypi-supply-chain-attack-pth-file-miasma"},{"type":"WEB","url":"https://socket.dev/blog/mini-shai-hulud-miasma-and-hades-worms-target-bioinformatics-and-mcp-developers-via-malicious"},{"type":"PACKAGE","url":"https://pypi.org/project/coolbox/0.4.1/"}],"affected":[{"package":{"name":"coolbox","ecosystem":"PyPI","purl":"pkg:pypi/coolbox"},"versions":["0.4.1","0.4.2"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/coolbox/MAL-2026-5295.json","cwes":[{"cweId":"CWE-506","name":"Embedded Malicious Code","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"evidence_files":[{"sha256":"c539766062555d47716f8432e73adbe3a0c0c954a0b6c4005017a668975e275c","tlsh":"4911c02e429385b0d975d646830b19f4afdb8ce28fc79506c8d8d4c1a7b2e50e3b7684","path":"coolbox-setup.pth"},{"sha256":"5a956a1a5bd6e3f07f3c148daba57974d2e6a7a4b2d7c008770eb45399cd6343","tlsh":"6bf1e999695ae08e37830a92ab414bb53f654617f0c3345cab008739f3cd7fad93e646","path":"coolbox-0.4.1.dist-info/RECORD"}],"package_integrity":[{"hashes":{"sha256":"676713804352b10f813c3371abffaac2ae670a53dbd924ebaae2e3b190b91eae","md5":"5ca17f568e14c68bbd1df8357fbe8964","blake2b_256":"9f02a14a518d8d7732b6cf4b6bf3eb6c0e9f047cfc1596ef56a15541d6350206"},"filename":"coolbox-0.4.1-py3-none-any.whl"}]}}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"REPORTER"}]}