Hackers Compromise LiteLLM PyPI Package to Steal AI API Keys and Cloud Credentials

Attackers compromised LiteLLM version 1.107.0 on PyPI and published container images, distributing malware designed to steal AI provider keys, cloud credentials, and developer secrets.

Socket disclosed the supply chain attack on October 21, 2026, after its scanner flagged seven malicious wheels approximately seven minutes. The packages target Windows, Linux, and macOS environments.

LiteLLM provides a unified interface and proxy for large language model providers, receiving approximately 23 million weekly downloads. Its access to provider keys, cloud identities, and database connections makes compromised deployments particularly sensitive.

Hackers Compromise LiteLLM PyPI Package

Container build provenance recorded Berri-AI/litellm as its source, rather than the legitimate BerriAI/litellm repository. The additional hyphen distinguishes the lookalike repository used in the recorded build inputs.

Investigators found packaging changes that introduced a cook directory through Maturin configuration and Dockerfile instructions. Three startup files in the referenced revision matched the inspected PyPI wheel byte for byte.

However, available evidence does not establish how the source override was authorized or whether the same workflow published the wheels.

Exposure extended beyond explicitly versioned deployments. During registry checks, v1.107.0, latest, main-latest, and main-stable resolved to the same affected image index.

The wheels install cook.pth, cook.py, and sitecustomize.py into Python’s library directory. The .pth file executes import cook, activating the collector during normal interpreter startup without requiring an application to import LiteLLM.

Running Python or pip during investigation can therefore trigger the malware again. The privcollect payload contains 16 collection modules targeting AWS, Azure, Google Cloud, Kubernetes, Docker, Git credentials, SSH keys, environment variables, and browser databases.

It also searches authentication files associated with Codex, Claude, Gemini, and Cursor. For LiteLLM deployments with DATABASE_URL configured, the malware attempts database queries against LiteLLM_CredentialsTable and LiteLLM_ProxyModelTable, requesting up to 500 records from each.

The malware encrypts collected information using AES-256-CBC, with the encryption key wrapped using RSA-4096 OAEP. The resulting archive is uploaded to hxxp://www[.]litellm[.]dev/healthcheck.

Separately, sitecustomize.py launches a detached loader that retrieves domain.txt from the letters9813/pythonclient-test GitHub repository.

A supplied destination can direct it to download and execute Python from /codepy without signature verification. An observed empty pointer did not disable the independent collector.

Socket said blocking version 1.107.0, stopping affected image deployments, and isolating environments where Python executed after installation.

Responders should preserve evidence, inspect systems using trusted tooling, and rotate potentially exposed credentials from clean environments.

Removing LiteLLM alone neither eliminates startup files nor terminates an existing loader. Recovery should rebuild environments from reviewed artifacts, pin container digests, and investigate credential misuse.

IoC

TypeIndicator
Packagelitellm==1.107.0
Exfiltrationhxxp://www[.]litellm[.]dev/healthcheck
Loader pointerhxxps://raw[.]githubusercontent[.]com/letters9813/pythonclient-test/main/domain.txt
Upload headerX-Token: XWiA8gZNa7NcX2XRoAEb
Loader lock/tmp/remote_code_loader.lock
Collection marker/tmp/.pc_once_72129118c59f5636c0bb
cook.py SHA-2569dd0a3926f96a37eb86cf1ee2310d9be93139cc4ebef3ef9e2efe9531390be25
sitecustomize.py SHA-25634bef04fe88ac9d0aae0475630b1738681d15b94f233ac8aa46eacf5968305fa

Note: IP addresses and domains are intentionally defanged (e.g., [.]) to prevent accidental resolution or hyperlinking. Re-fang only within controlled threat intelligence platforms such as MISP, VirusTotal, or your SIEM.

Join 16,000+ SOC teams using ANY.RUN to streamline threat investigations and reduce manual effort. Explore for your team 

Tamilselvan
Tamilselvanhttps://cyberpress.org/
Tamilselvan is an Investigative cybersecurity journalist dedicated to breaking stories on ransomware cartels, data breaches, and state-sponsored espionage.

Trending News

Related Stories