Linux Kernel & OS

LiteLLM supply chain attack spreads credential-stealing malware via PyPI, Docker

Key Takeaway

Attackers compromised LiteLLM's release process to distribute trojanized version 1.107.0 containing an infostealer and remote access trojan through PyPI and Docker registries.

Summary

Unknown attackers compromised the release pipeline for LiteLLM, a popular open source AI gateway with approximately 23 million weekly downloads, on Wednesday. They distributed malicious version 1.107.0 through PyPI and Docker Hub/GHCR containing malware that steals cloud credentials, AI service API keys, browser data, and SSH keys, plus a RAT enabling remote code execution. PyPI quarantined the package within hours and Docker images were removed, but users who ran the compromised version should assume secrets were stolen. The safe version is v1.106.2.

How the LiteLLM compromise worked

  • Attackers used a hyphenated typosquatting organization github.com/Berri-AI/litellm to inject malicious commits into the release pipeline
  • Three malicious files were planted: cook.pth (Python path hook), cook.py (infostealer), and sitecustomize.py (RAT)
  • cook.pth auto-executes cook.py every time Python starts; sitecustomize.py also runs at interpreter startup as a background daemon
  • The infostealer operates across 16 modules targeting browsers (Chrome, Firefox, Edge, Safari), cloud providers (AWS, GCP, Azure), and AI services (OpenAI, Anthropic, Cohere)
  • Stolen data is encrypted with AES-256-CBC, key wrapped with RSA-4096, and exfiltrated via HTTP POST to www.litellm.dev/healthcheck
  • The RAT daemon polls attacker infrastructure hourly for new commands
  • IOCs: /tmp/.pc_once_* (exfiltration occurred) and /tmp/remote_code_loader.lock (C2 active or was active)

Why it matters

Given LiteLLM's role as a unified API gateway for multiple LLM providers and its 23 million weekly downloads, the compromise exposes a critical supply chain vector for AI infrastructure. Organizations running the malicious version likely leaked cloud identities, database connections, and LLM API keys—credentials that could enable further lateral movement and unauthorized AI service access.

What to do

  • If you installed or ran LiteLLM version 1.107.0 from PyPI or Docker (including tags latest, main-latest, or main-stable), assume your secrets have been stolen and investigate immediately.
  • Check your systems for indicators of compromise: /tmp/.pc_once_* means data was already exfiltrated, and /tmp/remote_code_loader.lock means the RAT daemon ran or is still running.
  • Stop deploying version 1.107.0 and update to the safe version v1.106.2.
  • Investigate any environment where Python ran after the malicious installation, including proxy containers and CI runners.

Original reference: www.theregister.com →