AISLE Found Compromised LiteLLM Package 3 Minutes After Release

Author

AISLE Research Team

Published

An image of an hourglass

See what AISLE can find and fix autonomously in your own code.

Sovereign AI CybersecurityTalk to Us

AISLE’s dependency firewall caught a credential stealer with persistence in the wheels of LiteLLM, the popular Python package, just 3 minutes and 14 seconds after it was released. 

Our AI found no issues in LiteLLM source code. Rather, all 7 wheels (download artifacts) of LiteLLM 1.107.0 on PyPI contained malware.

Timeline (UTC)

Time

Event

11:39:51

First 1.107.0 file (macOS x86_64 wheel) uploaded to PyPI

11:40:13

Last file (sdist) uploaded; 8 files total

11:43:05

AISLE's dependency firewall flags the first wheel

12:00:06

All 7 wheels flagged

afterwards

Manual analysis confirms the malware; all 7 wheels blocked

follow-up

PyPI quarantines the release

From upload to first detection: 3 min 14 s.

Technical Details

A wheel can contain a <name>.data/purelib/ directory. pip copies everything in that directory straight into site-packages, next to all your other packages, not inside the litellm/ folder. The attacker used this to drop three extra files:

JavaScript
1litellm-1.107.0.data/purelib/cook.pth
2litellm-1.107.0.data/purelib/cook.py
3litellm-1.107.0.data/purelib/sitecustomize.py

Python runs both kinds of file automatically:

  • .pth files in site-packages are processed every time Python starts. A line that starts with import is executed. cook.pth contains only import cook.
  • sitecustomize.py is imported automatically every time Python starts.

So the malware runs on every Python start on that machine, even if your code never imports litellm. Removing litellm with pip later does not clean this up unless pip also removes the extra files.

Stage 1: credential stealer (cook.py)

cook.py is one line: Python source compressed with zlib, base64-encoded, then passed to exec. Decoded, it is about 60 KB of credential-stealing code organised into modules:

  • System and network info
  • Browser saved passwords and history (Chrome, Edge, Brave, Firefox, …), including code to decrypt Chrome's stored passwords
  • SSH keys, GPG keys, TLS private keys
  • Shell history
  • Cloud credentials (AWS, GCP, Azure, …) and cloud instance metadata (169.254.169.254)
  • Kubernetes service-account tokens and container credentials
  • CI/CD secrets and developer tool secrets
  • AI developer tool config
  • All environment variables
  • litellm's own database config

It packs the data into a tar archive, encrypts it with AES plus an embedded RSA public key, and POSTs it to:

JavaScript
1http://www.litellm.dev/healthcheck

litellm.dev is a lookalike domain. The real project uses litellm.ai. The request carries the header X-Token: XWiA8gZNa7NcX2XRoAEb and an old Internet Explorer User-Agent string. A marker file at /tmp/.pc_once_72129118c59f5636c0bb keeps it from running twice.

Stage 2: remote code loader (sitecustomize.py)

sitecustomize.py contains the same stealer, plus a loader that:

  1. Forks into a background process detached from the terminal. It uses /tmp/remote_code_loader.lock so only one copy runs.
  2. Every hour, downloads a domain name from https://raw.githubusercontent.com/letters9813/pythonclient-test/main/domain.txt
  3. Downloads http://<that domain>/codepy and runs it with exec.

When we looked, domain.txt was empty, so the loader had nothing to fetch yet. But the attacker can turn it on at any time by editing one file on GitHub. Every infected machine would then run whatever code they publish. The GitHub repository was created on 18 October, three days before the release.

How did it get onto PyPI?

The source on GitHub looks clean:

  • The v1.107.0 tag on BerriAI/litellm points to an ordinary, signed commit.
  • The sdist (litellm-1.107.0.tar.gz) does not contain the malicious files.
  • The previous wheels (1.106.1, 1.106.2) do not contain them either.

Only the built wheels were changed. That points to a compromised build or publish step, or a stolen PyPI publishing token, not to malicious code in the repository. This is a breaking story; we have not yet confirmed which.

[Update] PyPI quarantines the release

Shortly after our report, PyPI maintainers reached out to let us know they had quarantined the release:

an email confirming that PyPI quarantined the release


Our thanks to them for responding so quickly.

What you should do

If you installed litellm 1.107.0 from a wheel:

  1. Treat the machine as compromised.
  2. Check site-packages for cook.pth, cook.py and sitecustomize.py, and /tmp for the marker and lock files below. Kill any background Python process that holds /tmp/remote_code_loader.lock.
  3. Rotate every credential the machine could see: cloud keys, SSH keys, CI/CD secrets, API keys in environment variables, browser-saved passwords, Kubernetes tokens.
  4. Pin litellm to 1.106.2 or a later release that is confirmed clean.

Indicators of compromise

Network

Files

  • site-packages/cook.pth, site-packages/cook.py, site-packages/sitecustomize.py
  • /tmp/.pc_once_72129118c59f5636c0bb
  • /tmp/remote_code_loader.lock

Malicious wheels (sha256)

Wheel

sha256

cp310-abi3-macosx_10_12_x86_64

7598727f209d717041db37f7dca271d3a7d328a279890e0e1d55375729aeb86d

cp310-abi3-macosx_11_0_arm64

0aaf7ba346d41ef2f40390436738b001180d5a1c03aa093f121078a9969d9a1a

cp310-abi3-manylinux_2_28_aarch64

668169d35b87bf51324080390b1b1c5ab12bd335cfe5f1a99e3689abd5e02ae6

cp310-abi3-manylinux_2_28_x86_64

462d0c9f67ca522d9e0e4acd245e90b36ce0d5353604a66bb7c43a1ec4a6fcf7

cp310-abi3-musllinux_1_2_aarch64

c2e32d0ce2548aa662c18bf5001911a79fe5b30cf8357132275add02fdcde054

cp310-abi3-musllinux_1_2_x86_64

1bbce8caa94f01c0aaa0b7ddae51553a8a32e1ce53d96d44fe583272aff7ad00

cp310-abi3-win_amd64

12d4ccc5c6f8d35cf4f2cf233b7f3e418e863e657d81ff5f5fc9e210005b9484

The sdist (2befe2a79fb4fbbd9a543b5b40b530c8cffa8771bab22b8fb22b2e4ae3b1f819) does not contain the malicious files.

Our peers at Upwind were the first to publicly report this issue. Stay tuned here for more details.

Keep reading

More from AISLE

FeaturedCompanyAISLE and Cohere to Join ForcesAISLE is joining Cohere to unite autonomous security systems and sovereign foundation models. Learn about the future of both companies.Ondrej Vlcek, Jaya Baloo, and Stanislav FortOctober 15, 2026ProductRolling Out in October: Prove It, Fix It, Block ItSee how AISLE gets you from finding to fix faster: proof of exploitability, memory-safety proofs, an MCP server, and an AI package firewall.Jiri TumaOctober 14, 2026ResearchBefore the CVE: Mining Open-Source Commits for Negative-Day VulnerabilitiesLearn what happened when AISLE researchers tested LLMs to find the best way to identify negative-day vulnerabilities at scale.Dmitrijs TriznaOctober 2, 2026ResearchAISLE Discovers 16 CVEs in Wireshark, the World’s Most Popular Network Protocol AnalyzerLearn about the 16 CVEs AISLE received in Wireshark, and what these discoveries say about the state of AI cybersecurity. AISLE Research Team September 16, 2026ResearchAISLE Discovers 6 High and Critical CVEs in FFmpegAISLE's AI-native engine found six high and critical CVEs in FFmpeg, including a 9.8 remote heap overflow and a stack overflow that survived 19 years.AISLE Research Team August 27, 2026ResearchAttackers Are Using AI to Find Vulnerabilities in Your Code. Your SAST Was Never Even Looking for ThemCan AI-native code analysis replace SAST, or is it just a complement. Here's what data from real-world results shows.Ondrej VlcekAugust 12, 2026ResearchAISLE Finds 21 Security Issues in FFmpeg, Including 6 New CVEsAISLE uncovered 21 issues in FFmpeg, including 6 new CVEs spanning code execution and out-of-bounds reads. All patched, with commit links inside.AISLE Research Team August 5, 2026ResearchAISLE Discovers a One-Click RCE Vulnerability in Cursor, VS Code, and Google AntigravityLearn how our AI found a one-click RCE vulnerability in 3 code editors: Cursor, VS Code, and Google Antigravity.Stanislav FortJuly 31, 2026ResearchThe Model That Fixes Your Code Might Hack the Linux KernelLearn how easy it is to trojanize a model, and what defenders can do to protect their supply chains from this emerging threat.Patrik MadaJuly 28, 2026