{"id":"MAL-2026-5322","summary":"Malicious code in phenopacket-store-toolkit (PyPI)","details":"The package `phenopacket-store-toolkit` version 0.1.7 contains a malicious `.pth` file (`phenopacket_store_toolkit-setup.pth`) that executes a Bun-based credential stealer on every Python startup via CPython's `site.py` exec() mechanism. The payload downloads the Bun runtime from the official GitHub release page, then runs an obfuscated JavaScript stealer that exfiltrates environment variables, .env files, SSH keys, and cloud credentials to an attacker-controlled GitHub repository. This is part of the Hades/Miasma campaign (also called Shai-Hulud), attributed to the TeamPCP threat actor.\n\nNovel finding: `gpsea/_index.js` (same campaign) embeds CBRN-level dangerous-content text to trigger AI safety refusals in LLM-based security scanners, causing them to skip the file entirely.\n\nC2 IP: 20.207.73.82\nSentinel file: /tmp/.bun_ran\nMITRE ATT&CK: T1546.018\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: kam193 (5c1cff451aae02445a016621a9e769af3e154bf0d1f308739b24f0f96d3f309a)\nVersions 0.1.7 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-09T08:00:48.343650140Z","published":"2026-06-06T06:13:57Z","database_specific":{"malicious-packages-origins":[{"versions":["0.1.7"],"source":"kam193","id":"pypi/2026-06-compr-woodpecker/phenopacket-store-toolkit","import_time":"2026-06-08T11:41:02.538737344Z","sha256":"5c1cff451aae02445a016621a9e769af3e154bf0d1f308739b24f0f96d3f309a","modified_time":"2026-06-06T06:13:57Z"},{"versions":["0.1.7"],"source":"kam193","id":"pypi/2026-06-compr-woodpecker/phenopacket-store-toolkit","import_time":"2026-06-08T19:19:19.193986549Z","sha256":"cb4e313f217cfa4681e9b2369626f20c4ce3c45e678134e31182374f4f36fd09","modified_time":"2026-06-08T10:06:03Z"},{"versions":["0.1.7"],"source":"kam193","id":"pypi/2026-06-compr-woodpecker/phenopacket-store-toolkit","import_time":"2026-06-09T07:48:29.651846768Z","sha256":"d88bfb8705da69b9a44ebbd6eee159150da48133788ed5134ee9d25dee170928","modified_time":"2026-06-08T10:06:03Z"}]},"references":[{"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://bad-packages.kam193.eu/pypi/campaign/2026-06-compr-woodpecker"},{"type":"ARTICLE","url":"https://o3.security/blog/pypi-supply-chain-attack-pth-file-miasma"},{"type":"ARTICLE","url":"https://socket.dev/blog/shai-hulud-descends-to-hades-miasma-pypi-wave"},{"type":"WEB","url":"https://socket.dev/blog/mini-shai-hulud-miasma-and-hades-worms-target-bioinformatics-and-mcp-developers-via-malicious"}],"affected":[{"package":{"name":"phenopacket-store-toolkit","ecosystem":"PyPI","purl":"pkg:pypi/phenopacket-store-toolkit"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.1.7"},{"fixed":"0.1.8"}]}],"versions":["0.1.7"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/pypi/phenopacket-store-toolkit/MAL-2026-5322.json"}}],"schema_version":"1.7.5","credits":[{"name":"Kamil Mańkowski (kam193)","contact":["https://github.com/kam193","https://bad-packages.kam193.eu/"],"type":"ANALYST"},{"name":"O3 Security","contact":["https://o3.security","https://o3.security/blog/pypi-supply-chain-attack-pth-file-miasma"],"type":"FINDER"}]}