LiteLLM Supply Chain Attack: What Happened, Who’s Affected, and What You Should Do Right Now

· Source: Comet · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cybersecurity & Data Privacy · Depth: Intermediate, medium

Summary

On March 24, 2026, the Python package litellm, a critical dependency for numerous AI agent frameworks with 95 million monthly downloads, was subjected to a supply chain attack. An attacker compromised the maintainer's PyPI credentials and published two malicious versions, 1.82.7 and 1.82.8. Version 1.82.7 contained a payload in `litellm/proxy/proxy_server.py`, while version 1.82.8 utilized a `.pth` file (`litellm_init.pth`) for automatic execution upon any Python interpreter startup. The malicious code, double base64-encoded, harvested a wide array of credentials including environment variables, cloud keys (AWS, GCP, Azure), SSH keys, Kubernetes configs, Git credentials, Docker configs, database credentials, CI/CD secrets, and shell histories. This data was encrypted with AES-256-CBC and exfiltrated to `models.litellm.cloud`, a domain registered shortly before the attack. The exposure window lasted approximately four hours, primarily impacting CI/CD pipelines and any environments that installed or upgraded litellm or its direct dependencies like CrewAI or DSPy during this period.

Key takeaway

For AI Engineers and ML teams managing Python environments, immediately check all your virtual environments and CI/CD pipelines for litellm versions 1.82.7 or 1.82.8. If affected, stop using the environment, delete and recreate it, and rotate all credentials present on the machine. Implement strict dependency pinning (e.g., `litellm==1.82.6`) and use lockfiles to prevent similar supply chain vulnerabilities from impacting your stack.

Key insights

A litellm supply chain attack compromised PyPI, exfiltrating credentials via malicious package versions.

Principles

Method

The attack involved compromising PyPI credentials, publishing malicious package versions (1.82.7, 1.82.8), embedding payloads in `proxy_server.py` or using `.pth` files for auto-execution, and exfiltrating encrypted credentials to an attacker-controlled domain.

In practice

Topics

Code references

Best for: AI Engineer, Machine Learning Engineer, AI Security Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Comet.