Skip to content
Mohammad Awadallah
All posts

Two hours were enough: what the LiteLLM 1.107.0 compromise teaches

On 21 October 2026 a malicious LiteLLM release reached PyPI and Docker Hub and stole cloud credentials. What happened, and how to protect the AI containers you run yourself.

4 min readAlso in:العربيةFrançais

LiteLLM is a popular library and proxy that puts many model providers behind one API — which is why it usually sits in the most sensitive spot in a stack: right next to every API key. On 21 October 2026, version 1.107.0 was published with code that stole those keys and more. The code in the project’s official repository was clean; the malicious release was built from a lookalike repository and shipped through the official release pipeline.

What happened

According to the LiteLLM team’s incident report:

  • PyPI: the malicious packages were live from 11:39 to 13:23 UTC.
  • Docker Hub: the tags v1.107.0, latest, main-latest and main-stable pointed to the malicious build from 11:46 to 14:20.
  • GHCR: the same four tags until 13:51.

Note that latest and main-stable were among the affected tags. Anyone automatically pulling “the latest stable” during those hours got the malware.

What it did. Per Microsoft’s analysis, the package dropped cook.pth and sitecustomize.py into Python’s site-packages. Python runs these on every interpreter start, even if LiteLLM is never imported. They collected AWS, Azure and GCP credentials, Kubernetes and Docker configs, SSH keys, .env files, environment variables, and the proxy’s database including provider keys, then encrypted the lot and sent it to an outside domain.

How it was caught. A security researcher opened a GitHub issue about twenty minutes after publication. The root cause, per the team’s report, was an admin key for one of their systems committed to a public repository in May and never revoked; months later it was used to reach developer accounts and get past the release pipeline’s protections.

If you were affected

If a machine or container of yours installed 1.107.0 that day, the team’s instructions are clear:

  • Don’t run pip or python on the suspect host first — the malicious file runs on every start.
  • Delete the malicious files, kill the background process, then reinstall 1.106.2 or rebuild the container.
  • Rotate every secret the host could reach: provider keys, the proxy’s master and virtual keys, the database password, cloud permissions.

The key lesson: a signature wasn’t enough

This point deserves a pause. Per the team’s report, the malicious images carried a valid signature from the project’s old cosign key, and the PyPI release carried valid Trusted Publishing provenance. A signature proves which pipeline built an artifact, not that the source was legitimate. When the pipeline itself is compromised, it signs bad builds just as it signs good ones.

Protecting your containers

1. Pin images by digest, not tag. A tag like latest is a moving pointer that can change at any moment. A digest doesn’t:

services:
  litellm:
    image: ghcr.io/berriai/litellm@sha256:<digest-you-reviewed>

The trade-off, as Docker’s own docs note: a digest-pinned image won’t pick up security updates automatically. That’s the point — updating becomes your decision.

2. Don’t update on release day. Update bots can wait before proposing a new release: Renovate has minimumReleaseAge (for example "3 days"), Dependabot has cooldown. In the LiteLLM incident, waiting a single day would have avoided it entirely.

3. Pin Python packages by hash too. A requirements file can carry each package’s hash, and with pip install --require-hashes pip rejects any file that doesn’t match. Be clear about the limit: it protects you from a file you locked changing, not from locking a malicious version in the first place.

4. Cut internet access for containers that don’t need it. The malware had to send what it stole somewhere. In Docker Compose, a network declared with internal: true is isolated from the outside. The proxy itself obviously needs to reach model providers, but the database and internal services don’t. Where egress is required, an egress proxy that allows specific domains beats the whole internet.

5. Give each container only its own secrets. A container holding one provider key leaks one key. A container with the whole project’s .env leaks everything.

6. Look before you upgrade. Before moving a digest to a new release, glance at the release page and the repository’s open issues. In this incident, the report was filed within twenty minutes.

The takeaway

There was nothing an ordinary user could have spotted: the release came from the right place with the right signature. The only effective protection was a set of simple habits — don’t pull latest automatically, wait before updating, pin digests, and let each container know and reach as little as possible. They cost next to nothing, and they turn an incident like this from “rotate all your keys” into “I read about it in the news”.