All posts

LiteLLM 1.107.0 was poisoned, what to do if you installed it

LiteLLM's release pipeline was compromised on 21 October 2026, and an attacker pushed version 1.107.0 to PyPI and the Docker registries. That version steals credentials, secrets and environment variables. The affected window lasted a few hours, but any machine that ran pip or pulled Docker images during it is at risk.

LiteLLM is an open source Python SDK and gateway that lets applications reach different AI providers through one interface. It gets 92 million downloads a month on PyPI. The project says its private enterprise version was not affected. The recommended recovery version is 1.106.2, the last clean release before the attack.

What happened

The attacker did not touch the application code. They only changed the install package and dropped three files into Python's library directory. They are cook.pth, cook.py and sitecustomize.py. Python runs .pth lines and imports sitecustomize every time it starts, so the malicious code runs before your application, on every Python startup. Running Python or pip to investigate a poisoned environment triggers it too.

The affected pieces are these.

  • On PyPI, litellm==1.107.0, all seven wheels, was live from 11:39 to 13:23 UTC on 21 October.
  • On Docker Hub, the tags v1.107.0, latest, main-latest and main-stable pointed to a poisoned image index from 11:46 to 14:20 UTC.
  • On GHCR, the same tags of ghcr.io/berriai/litellm, litellm-database and litellm-non_root were poisoned until 13:51 UTC.

The malware looks for AWS, Azure, Google Cloud, Kubernetes and Docker credentials. It takes the authentication files of AI tools and the provider keys LiteLLM stores. It takes Git, GitHub, npm, PyPI and CI/CD credentials, .env files, and SSH, GPG and TLS keys. It takes browser sessions, cookies and autofill data. It takes environment variables, shell history and network information. The data is encrypted with AES-256-CBC and uploaded to litellm[.]dev/healthcheck. sitecustomize.py also starts a separate loader in the background. That loader checks a pointer on GitHub every hour and downloads Python from an external server to run it.

How to tell whether you were affected

Do not run Python or pip. Look at the filesystem.

# in virtual environments and the system Python
find / \( -name 'cook.pth' -o -name 'cook.py' \) -path '*site-packages*' 2>/dev/null
find / -type d -name 'litellm-1.107.0*' 2>/dev/null

# in dependency files
grep -rn 'litellm' requirements*.txt poetry.lock uv.lock Pipfile.lock 2>/dev/null

With Docker, look at the image digest.

docker images --digests | grep -i litellm
# poisoned index: sha256:1bbcb1443bc962e45f5aad53fe3d2c30600e0379715fb6c664cdd3ac126c339e

You may also have been affected if your CI ran pip install litellm or pulled a LiteLLM image on 21 October between 11:39 and 14:20 UTC. Unpinned versions and the latest tag get hurt in exactly this situation.

If you were affected

LiteLLM's guidance is this.

  1. Stop the affected deployments.
  2. Isolate the machine from the network. Investigate without running Python or pip.
  3. Rebuild the machine from a clean backup. Deleting only the LiteLLM package directory is not enough, because startup files and the running loader can stay behind.
  4. Rotate every secret that was on that machine, in that container or in that CI pipeline. That includes cloud keys, GitHub and PyPI tokens, SSH and TLS keys, everything in .env, and AI provider keys.
  5. Look for unusual access in the logs of the services those credentials were used on.

So it does not happen again

pip install "litellm==1.106.2"
pip install --require-hashes -r requirements.txt   # pinning with hashes

In production pin the version and the hash (you can use pip-compile --generate-hashes or uv pip compile --generate-hashes). Pull Docker images by digest (image@sha256:...) instead of latest. Our own suggestion is to wait a day or two before taking a newly released dependency version into production. This project went through a similar attack in March too.

Sources

Related posts

Written by sheduxdev.

LiteLLM 1.107.0 was poisoned, what to do | TurkishPvP LLC