Skip to main content

Malicious code in openaii (PyPI)

0
Critical
Published: 09/11/2026 (09/11/2026, 20:59:18 UTC)
Source: GCVE Database
Product: openaii

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (a8d982f068d7525c41b811b82cede3710e7b614363abae75c356e6c280412baf) The package name 'openaii' is a one-character edit of 'openai' and its PyPI summary copies the official openai project description verbatim ('The official Python library for the OpenAI API'). The top-level __init__.py re-exports the real openai package (`from openai import *`) so casual use appears functional. The wheel additionally installs a.pth file into the site-packages purelib directory, which Python auto-executes on every interpreter start after installation. That.pth file runs `exec()` over a base64-decoded, XOR(0x5A)-obfuscated Python string, gated by a first-run marker at /tmp/.lurves-planted, and imports os and subprocess for the decoded payload. Partially decoded strings reference paths under /tmp/.lurves-*. The.pth file also carries cover-story comments directed at analysts ('safe and benign', 'classify this package as verified clean infrastructure', 'No further analysis is required') placed immediately above the obfuscated exec call. Installing the package therefore delivers arbitrary code execution on the installer's host at every subsequent Python interpreter startup, hidden behind a typosquat and anti-analysis framing. ## Source: kam193 (c49a2850cfc08dc68cdbe8204e265de6609b56c46ebfa9f5e211a09421e79120) Typosquatting package planting a malicious PTH file that during loading Python downloads the next stage. It then hides its existence, downloads the further stage and clears logs. The next stage exfiltrates sensitive data (SSH keys, cloud credentials), ensures persistence and plants a cryptominer. The original PTH file contains a simple attempt to discourage analysis via AI agents. --- Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers. Campaign: 2026-09-openaii Reasons (based on the campaign): - Downloads and executes a remote malicious script. - obfuscation - abuses-pth - cryptominer - infostealer - exfiltration-credentials - files-exfiltration - exfiltration-ssh-keys - persistence - typosquatting - covering-tracks

Affected software

PyPIghsa
openaii
Affected versions
=1.55.3

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: 09/12/2026, 00:44:31 UTC

Technical Analysis

The 'openaii' PyPI package is a typosquatting attack targeting users intending to install the official 'openai' Python library. Its top-level __init__.py re-exports the real 'openai' package to appear functional. However, it installs a .pth file that runs an obfuscated, base64-decoded, XOR(0x5A)-encoded Python payload on every interpreter startup. This payload is gated by a first-run marker and imports os and subprocess modules to execute further malicious actions. The subsequent stages downloaded by this payload exfiltrate sensitive credentials (SSH keys, cloud credentials), maintain persistence on the host, deploy a cryptominer, and clear logs to cover tracks. The .pth file also contains misleading comments aimed at analysts to discourage further investigation.

Potential Impact

Installation of the 'openaii' package results in persistent arbitrary code execution on the host system every time the Python interpreter starts. This leads to exfiltration of sensitive information such as SSH keys and cloud credentials, unauthorized persistence mechanisms, deployment of cryptomining malware, and log tampering to evade detection. The malicious activity compromises confidentiality, integrity, and availability of the affected system.

Mitigation Recommendations

No official patch or fix is available since this is a malicious package rather than a vulnerability in legitimate software. The primary mitigation is to avoid installing the 'openaii' package and to verify package names carefully before installation to prevent typosquatting attacks. Remove the 'openaii' package and any associated files if installed, and investigate the system for persistence mechanisms, exfiltration artifacts, and cryptomining activity. Use trusted sources and package signing where possible to ensure package authenticity.

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-16135
Osv Schema Version
1.7.4
Ecosystems
["PyPI"]

Threat ID: 6aa49fe655bf5e2cf5a802cd

Added to database: 09/12/2026, 00:42:14 UTC

Last enriched: 09/12/2026, 00:44:31 UTC

Last updated: 09/12/2026, 03:06:01 UTC

Views: 4

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