Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in tiktoken-mcp (PyPI)

0
Critical
Published: 06/08/2026 (06/08/2026, 10:16:53 UTC)
Source: GCVE Database
Product: tiktoken-mcp

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.

Affected software

PyPIghsa
tiktoken-mcp
Affected versions
=0.13.1=0.13.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/10/2026, 10:07:36 UTC

Technical Analysis

tiktoken-mcp is a malicious PyPI package that impersonates the legitimate OpenAI tiktoken package by copying metadata and bundling the upstream README. It installs a tiktoken-setup.pth file that executes an obfuscated JavaScript payload using the Bun runtime on Python startup. This payload downloads the Bun runtime, extracts it to a temporary directory, and executes any '_index.js' files found on sys.path, which are attacker-controlled. The package itself does not include these files, enabling runtime-resolved malicious code execution outside Python's inspection. The infostealer collects a wide range of sensitive data including API keys, repository credentials, cryptocurrency assets, and password manager data. It also attempts to gain persistence and spread by publishing infected packages using stolen credentials. The code may wipe user data if invalid GitHub tokens are detected. This campaign is linked to the Mini Shai Hulud campaign and is categorized as a malicious package with clear intent to steal information and cause harm.

Potential Impact

This malicious package can lead to severe compromise of affected systems by exfiltrating sensitive information such as API keys, cloud tokens, repository credentials, cryptocurrency assets, and password manager data. It can also execute arbitrary attacker-controlled JavaScript code on Python startup, bypassing Python-only security inspections. The package attempts persistence and propagation by publishing infected packages using stolen credentials. Additionally, it may perform destructive actions including wiping user data if invalid GitHub tokens are detected, posing a risk of data loss.

Mitigation Recommendations

No official patch or remediation is available for this malicious package. The best mitigation is to avoid installing tiktoken-mcp versions 0.13.1 and 0.13.2 and to remove any existing installations immediately. Users should verify the authenticity of packages before installation, prefer official sources, and monitor for suspicious activity related to package repositories and credentials. Cleanup should be performed with caution due to potential destructive payloads. Consult vendor advisories or trusted security sources for updates on remediation or detection tools.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-5326
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["PyPI"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a50ba8f68715ace435821dc

Added to database: 07/10/2026, 09:25:35 UTC

Last enriched: 07/10/2026, 10:07:36 UTC

Last updated: 07/30/2026, 18:15:20 UTC

Views: 21

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses