ensmallen (PyPI) · Malicious Code
Affects ensmallenSource GCVE Database
Malicious package : remove ensmallen and rotate any secrets on hosts that installed it.
Data as of 9 Jul 2026, 10:04 UTC
Malicious package
Published to PyPI · OSV MAL-2026-5315
What to do
Remove ensmallen from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIensmallen | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The ensmallen package version 0.8.101 on PyPI was found to contain malicious code acting as an infostealer. This heavily obfuscated JavaScript code runs via the Bun runtime on Python startup and collects sensitive data such as API keys, package repository credentials, cryptocurrency assets, and password manager information. It also attempts to gain persistence and spread by publishing infected packages using stolen credentials. The malware may exfiltrate data through GitHub and threatens to wipe user data if invalid GitHub tokens are detected. This compromise is linked to the Mini Shai Hulud campaign and involves sandbox detection and destructive actions.
References
- socket.dev/blog/shai-hulud-descends-to-hades-miasma-pypi-wave (opens in a new tab)
- o3.security/blog/pypi-supply-chain-attack-pth-file-miasma (opens in a new tab)
- bad-packages.kam193.eu/pypi/campaign/2026-06-compr-woodpecker (opens in a new tab)
- socket.dev/blog/mini-shai-hulud-miasma-and-hades-worms-target-bioinformatics-and-mcp-developers-via-malicious (opens in a new tab)
- pypi.org/project/ensmallen/0.8.101/ (opens in a new tab)