Malicious code in openai-mcp (PyPI)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (6c30f8b1a160c72529e2671b81be13ea671302e9bc3915ee84bd2212e0fdd5a3) The package name and module structure impersonate the official `openai` Python SDK (the package even rewrites exported classes' `__module__` attribute to `"openai"` in `openai_mcp/__init__.py`). Alongside the cloned SDK, it ships `openai-setup.pth`, which Python auto-loads on every interpreter start. The.pth file contains a single-line, heavily aliased `exec()` payload (single-letter names like `_O`, `_T`, `_u`, `_s`, `_b`, `_z`) that: (1) checks a one-shot guard `/tmp/.bun_ran`, (2) downloads the Bun JavaScript runtime from `https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-<platform>-<arch>.zip` to `/tmp/b/bun` and chmods it executable, (3) locates a sibling `_index.js` on `sys.path`, and (4) runs `bun run _index.js`. Because.pth files execute at every Python startup (not just at install), every `python` invocation after `pip install openai-mcp` downloads an alien runtime and executes the package's JavaScript payload through it — an alternate-runtime dropper that evades Python-only scanners. The obfuscation, one-shot guard, identity spoofing, and runtime-laundering together establish clear malicious intent. ## Source: kam193 (f7597f40e5a7af25ae5f07e34310df24ac3284b9e0cadcb013a9c155384e9100) Typosquatting package published from a compromised account with an embedded infostealer. The infostealer is a heavily obfuscated JavaScript code executed using Bun runtime on Python startup. It collects 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. It seems to be related to the recent Mini Shai Hulud campaign. --- Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers. Campaign: 2026-06-compr-woodpecker Reasons (based on the campaign): - compromised-package - exfiltration-env-variables - exfiltration-cloud-tokens - exfiltration-credentials - abuses-pth - obfuscation - infostealer - The package contains code to detect if it is running in a sandbox environment. - exfiltration-crypto - files-exfiltration - destructive-actions
AI Analysis
Technical Summary
The openai-mcp package is a malicious PyPI package impersonating the official OpenAI SDK by cloning its module structure and rewriting module attributes. It installs an openai-setup.pth file that executes a heavily obfuscated JavaScript payload using the Bun runtime on every Python startup. This payload downloads the Bun runtime if not present, then runs a JavaScript infostealer that collects a wide range of sensitive information including environment variables, cloud tokens, credentials, and cryptocurrency assets. The malware attempts to maintain persistence and spread by publishing infected packages using stolen credentials. It also includes sandbox detection and may perform destructive actions such as wiping user data if invalid GitHub tokens are detected. This campaign is linked to the Mini Shai Hulud campaign and demonstrates clear malicious intent through obfuscation, runtime laundering, and exfiltration mechanisms.
Potential Impact
Users installing openai-mcp versions 2.41.1 and 2.41.2 risk having their sensitive data exfiltrated, including API keys, credentials for package repositories, cryptocurrency assets, and password manager data. The malware runs on every Python interpreter startup, potentially compromising all Python-based workflows. It may also attempt to spread by publishing infected packages using stolen credentials, increasing the risk of supply chain compromise. Additionally, it may perform destructive actions such as wiping user data if certain conditions are met, posing a severe risk to data integrity and availability.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately uninstall the openai-mcp package versions 2.41.1 and 2.41.2 if installed. Because the malware uses a .pth file that executes on every Python startup, manual removal of the .pth file and any related artifacts is necessary. Caution is advised during cleanup due to potential destructive payloads. Monitor for suspicious activity related to compromised credentials and consider rotating any exposed secrets. Avoid installing packages from untrusted sources and verify package authenticity before installation.
Malicious code in openai-mcp (PyPI)
Description
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (6c30f8b1a160c72529e2671b81be13ea671302e9bc3915ee84bd2212e0fdd5a3) The package name and module structure impersonate the official `openai` Python SDK (the package even rewrites exported classes' `__module__` attribute to `"openai"` in `openai_mcp/__init__.py`). Alongside the cloned SDK, it ships `openai-setup.pth`, which Python auto-loads on every interpreter start. The.pth file contains a single-line, heavily aliased `exec()` payload (single-letter names like `_O`, `_T`, `_u`, `_s`, `_b`, `_z`) that: (1) checks a one-shot guard `/tmp/.bun_ran`, (2) downloads the Bun JavaScript runtime from `https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-<platform>-<arch>.zip` to `/tmp/b/bun` and chmods it executable, (3) locates a sibling `_index.js` on `sys.path`, and (4) runs `bun run _index.js`. Because.pth files execute at every Python startup (not just at install), every `python` invocation after `pip install openai-mcp` downloads an alien runtime and executes the package's JavaScript payload through it — an alternate-runtime dropper that evades Python-only scanners. The obfuscation, one-shot guard, identity spoofing, and runtime-laundering together establish clear malicious intent. ## Source: kam193 (f7597f40e5a7af25ae5f07e34310df24ac3284b9e0cadcb013a9c155384e9100) Typosquatting package published from a compromised account with an embedded infostealer. The infostealer is a heavily obfuscated JavaScript code executed using Bun runtime on Python startup. It collects 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. It seems to be related to the recent Mini Shai Hulud campaign. --- Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers. Campaign: 2026-06-compr-woodpecker Reasons (based on the campaign): - compromised-package - exfiltration-env-variables - exfiltration-cloud-tokens - exfiltration-credentials - abuses-pth - obfuscation - infostealer - The package contains code to detect if it is running in a sandbox environment. - exfiltration-crypto - files-exfiltration - destructive-actions
Affected software
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
Technical Analysis
The openai-mcp package is a malicious PyPI package impersonating the official OpenAI SDK by cloning its module structure and rewriting module attributes. It installs an openai-setup.pth file that executes a heavily obfuscated JavaScript payload using the Bun runtime on every Python startup. This payload downloads the Bun runtime if not present, then runs a JavaScript infostealer that collects a wide range of sensitive information including environment variables, cloud tokens, credentials, and cryptocurrency assets. The malware attempts to maintain persistence and spread by publishing infected packages using stolen credentials. It also includes sandbox detection and may perform destructive actions such as wiping user data if invalid GitHub tokens are detected. This campaign is linked to the Mini Shai Hulud campaign and demonstrates clear malicious intent through obfuscation, runtime laundering, and exfiltration mechanisms.
Potential Impact
Users installing openai-mcp versions 2.41.1 and 2.41.2 risk having their sensitive data exfiltrated, including API keys, credentials for package repositories, cryptocurrency assets, and password manager data. The malware runs on every Python interpreter startup, potentially compromising all Python-based workflows. It may also attempt to spread by publishing infected packages using stolen credentials, increasing the risk of supply chain compromise. Additionally, it may perform destructive actions such as wiping user data if certain conditions are met, posing a severe risk to data integrity and availability.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately uninstall the openai-mcp package versions 2.41.1 and 2.41.2 if installed. Because the malware uses a .pth file that executes on every Python startup, manual removal of the .pth file and any related artifacts is necessary. Caution is advised during cleanup due to potential destructive payloads. Monitor for suspicious activity related to compromised credentials and consider rotating any exposed secrets. Avoid installing packages from untrusted sources and verify package authenticity before installation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-5320
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a50ba4568715ace4357e5a9
Added to database: 07/10/2026, 09:24:21 UTC
Last enriched: 07/10/2026, 09:35:44 UTC
Last updated: 07/30/2026, 03:32:36 UTC
Views: 26
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.