LiteLLM, an open-source Python SDK and AI gateway used by companies including NVIDIA, Netflix, AT&T and Okta, disclosed that its release pipeline was compromised on October 21, allowing a threat actor to push version 1.107.0 to PyPI and the Docker registry containing compiled malware. The project's maintainer confirmed that the malicious release "contained compiled malware which steals credentials and loads remote-code execution tools."
According to a post-mortem, the attacker modified only the installation package, placing three malicious files, cook.pth, cook.py, and sitecustomize.py, in the Python library directory. Security researchers at Socket and Endor Labs noted that Python executes these files during normal startup, triggering the payload before the application runs each time Python launches. Even running Python or pip to investigate an infected system would activate the malware.
The malware targeted a broad range of sensitive data, including cloud and deployment credentials for AWS, Azure, Google Cloud, Kubernetes and Docker; AI authentication files and LiteLLM's stored provider credentials; developer secrets such as Git, GitHub, npm, PyPI and CI/CD credentials; environment variables, shell histories, and browser saved logins, cookies and payment data. The stolen information is encrypted with AES-256-CBC, protected by an RSA-4096 key, and exfiltrated to litellm[.]dev/healthcheck. One malicious file, sitecustomize.py, launches a detached loader that checks a GitHub-hosted pointer hourly to download and execute arbitrary Python code from an external server.
Multiple application security firms detected the attack within six minutes of publication and analysed the payload. The malicious artifacts, all seven PyPI wheels from 11:39:51 to 13:23 UTC, and Docker images on Docker Hub and GHCR, have been removed. The project recommends affected users stop compromised deployments, inspect environments without launching Python, isolate and rebuild from clean backups, and rotate all exposed secrets. The recommended recovery version is LiteLLM 1.106.2, the last known clean release before the attack.
This is not the first breach for LiteLLM. In March, the TeamPCP hacking group published malicious versions on PyPI after compromising the Aqua Security Trivy vulnerability scanner used in LiteLLM's CI/CD pipeline.
