# LiteLLM 1.107.0 on PyPI and Docker carried a credential stealer after a leaked master key

Source: https://botpassword.com/incidents/2026-10-litellm-1-107-0-compromise
Disclosed: 2026-10-21 · Type: Supply chain · Status: Contained · Updated: 2026-10-25

On 21 October 2026 an attacker published malicious `litellm==1.107.0` wheels to PyPI and pushed compromised Docker Hub and GHCR images, live for about two hours. The release ran a credential stealer at every Python start through `.pth` and `sitecustomize.py` files. LiteLLM traced it to a master key committed to a public repository in May, which let the attacker pull a GitHub organization owner's token. Anyone who ran 1.107.0 should remove the files, reinstall 1.106.2 and rotate every credential the host could reach.

## What was exposed

Any credential reachable from a host or container that ran the release. LiteLLM says the malware steals credentials and loads remote-code-execution tools, and its rotation guidance covers the instance or task IAM role, all model provider keys stored in the LiteLLM proxy database, LiteLLM master and virtual keys, the `DATABASE_URL` password and any secret in the environment of processes on the host. Microsoft found that the package added files Python runs during interpreter start, so the payload ran even if LiteLLM was never imported. Microsoft lists what the collector reads: auth and config files for AI assistants, IDEs, GitHub Copilot and MCP integrations; Git credentials, package-manager configs, `.env` and private key files; AWS, Azure and Google Cloud credential caches and metadata credentials; Kubernetes, Docker, Vault and CI/CD configs; SSH, GPG and TLS keys; process environments; and, on proxy hosts, provider credentials from the LiteLLM database. A detached daemon holding `/tmp/remote_code_loader.lock` kept running afterwards. The official `v1.107.0` source tag does not contain the malicious files, and LiteLLM says its private enterprise registry was not affected.

## Who is affected

You are affected if you installed `litellm==1.107.0` from PyPI between 11:39 and 13:23 UTC on 21 October 2026, or pulled Docker Hub or GHCR tags `v1.107.0`, `latest`, `main-latest` or `main-stable` (including the `litellm-database` and `litellm-non_root` images on GHCR) between 11:46 and 14:20 UTC. Look in site-packages for `cook.pth`, `cook.py` or `sitecustomize.py`, for `__pycache__/cook*.pyc`, and for a Python process holding `/tmp/remote_code_loader.lock`. In AWS, check CloudTrail for `GetCallerIdentity` from the instance role around install time.

## What to do

1. Do not run `pip install` first: any Python start re-runs the payload. From the shell, delete `cook.pth`, `cook.py`, `sitecustomize.py` and matching `.pyc` files from every affected site-packages directory.
2. Kill the detached Python process holding `/tmp/remote_code_loader.lock`, then reinstall pinned to `litellm==1.106.2`, preferably by rebuilding images and virtual environments.
3. Rotate the IAM role credentials, every provider key in the LiteLLM proxy database, LiteLLM master and virtual keys, the database password and all secrets in the host's environment.
4. Review CloudTrail and provider usage for activity from outside your infrastructure after the install.

## Keys to rotate

- [AWS (IAM access keys)](https://botpassword.com/keys/aws)
- [OpenAI](https://botpassword.com/keys/openai)
- [Anthropic](https://botpassword.com/keys/anthropic)
- [Google Gemini API](https://botpassword.com/keys/google-gemini)
- [Azure (Microsoft Entra app client secrets)](https://botpassword.com/keys/azure)
- [GitHub](https://botpassword.com/keys/github)

## Timeline

- 2026-05-27: A config file containing the master key for the LiteLLM Agent Platform is committed to a public repository and not revoked, per LiteLLM's root cause analysis. ([source](https://docs.litellm.ai/blog/security-incident-oct-21-2026-attack-chain))
- 2026-10-10: The attacker uses that key against the Agent Platform API, which returns a GitHub CLI OAuth token belonging to an organization owner; from 10 to 12 October CI workflows are used to take two maintainers' tokens. ([source](https://docs.litellm.ai/blog/security-incident-oct-21-2026-attack-chain))
- 2026-10-21: The release workflow is changed to build from the lookalike `Berri-AI/litellm` fork; seven malicious wheels reach PyPI at 11:39 UTC and images at 11:46 UTC. PyPI removes the version by 13:23 UTC; GHCR tags are unavailable by 13:51 and Docker Hub tags are cleaned by 14:20 UTC. ([source](https://docs.litellm.ai/blog/security-incident-oct-21-2026))
- 2026-10-23: LiteLLM publishes its canonical root cause analysis, correcting an earlier suspicion that the first token came from internal deployment logs. Microsoft publishes its analysis of the Python startup-hook technique the same day. ([source](https://docs.litellm.ai/blog/security-incident-oct-21-2026-attack-chain))

## Indicators

- `litellm==1.107.0` wheels; files `cook.pth`, `cook.py`, `sitecustomize.py`, `__pycache__/cook*.pyc`.
- `/tmp/remote_code_loader.lock` held by a detached Python daemon.
- Exfiltration to `www[.]litellm[.]dev` path `/healthcheck`; loader reading `raw.githubusercontent.com/letters9813/pythonclient-test/main/domain.txt`.
- Docker image index `sha256:1bbcb1443bc962e45f5aad53fe3d2c30600e0379715fb6c664cdd3ac126c339e`; release provenance pointing to `Berri-AI/litellm` instead of `BerriAI/litellm`.

## Sources

- https://docs.litellm.ai/blog/security-incident-oct-21-2026
- https://docs.litellm.ai/blog/security-incident-oct-21-2026-attack-chain
- https://www.microsoft.com/en-us/security/blog/2026/10/23/inside-the-litellm-1-107-0-supply-chain-compromise-credential-theft-through-python-startup-hooks/
