tiktoken-mcp (PyPI) · Malicious Code
Affects tiktoken-mcpSource GCVE Database
Malicious package : remove tiktoken-mcp and rotate any secrets on hosts that installed it.
Data as of 10 Jul 2026, 10:07 UTC
Malicious package
Published to PyPI · OSV MAL-2026-5326
What to do
Remove tiktoken-mcp 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 |
|---|---|---|
| PyPItiktoken-mcp | 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 tiktoken-mcp package on PyPI is a malicious typosquatting package impersonating the legitimate OpenAI tiktoken package. It includes a .pth file that executes obfuscated JavaScript code via the Bun runtime on every Python interpreter start. This code downloads the Bun runtime, searches for attacker-controlled JavaScript files on sys.path, and executes them, enabling stealthy execution outside Python inspection. The package acts as an infostealer, collecting sensitive data such as API keys, credentials, cryptocurrency assets, and password manager data, and attempts persistence and propagation by publishing infected packages. It may also perform destructive actions if invalid GitHub tokens are detected. The affected versions are 0.13.1 and 0.13.2.
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/package/tiktoken-mcp (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/tiktoken-mcp/0.13.1/ (opens in a new tab)
- pypi.org/project/tiktoken-mcp/0.13.2/ (opens in a new tab)