Skip to main content
MalwarePublished Updated

tiktoken-mcp (PyPI) · Malicious Code

Affects tiktoken-mcpSource GCVE Database

0

Malicious package : remove tiktoken-mcp and rotate any secrets on hosts that installed it.

Data as of 10 Jul 2026, 10:07 UTC

Classification

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

ProductAffectedFixed in
PyPItiktoken-mcpAffected
  • =0.13.1
  • =0.13.2
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

Community reviews

Loading reviews…