LiteLLM 1.107.0 was malware: check your gateway, rotate keys

On 21 October 2026 attackers used LiteLLM's own release pipeline to publish a poisoned LiteLLM 1.107.0 to PyPI and to the Docker tags latest, main-latest and main-stable. It steals passwords and API keys, and it runs every time Python starts.

Many home labs put LiteLLM in front of Ollama or paid AI keys. If your gateway was installed or pulled on 21 October, treat it as compromised. Removing the bad version is not enough: you must also change every key that machine could read.

~2hours

1.107.0 live on PyPI

4

Docker tags that held the bad image

1.106.2

clean version named by LiteLLM

3registries

PyPI, Docker Hub, GHCR

The short version#

TRUE

Version 1.107.0 contained malware

LiteLLM says it "steals credentials and loads remote-code execution tools". Microsoft confirms the malicious files.

TRUE

Importing LiteLLM is not needed

Microsoft says starting Python in an affected environment can be enough. Even pip runs the malware.

LIKELY

Only a short time window is dangerous

PyPI had the bad wheels from 11:39 to 13:23 UTC. The Docker tags were bad from 11:46 to 14:20 UTC. If you installed outside those times and did not run 1.107.0, you are probably fine.

UNKNOWN

Your keys were stolen

If the host had internet access, assume yes. If a marker file exists, theft is confirmed. If it does not, that proves nothing.

FALSE

The GitHub source for 1.107.0 was poisoned

LiteLLM says the official v1.107.0 source tag is clean. The bad files were built from a look-alike repository.

What happened#

LiteLLM is a gateway that gives many AI services one API. Its release pipeline builds the package and the Docker image. On 21 October an attacker changed that pipeline and pointed it at a look-alike repository, Berri-AI/litellm instead of BerriAI/litellm.

  • Record
  • Official

Record

A key is committed by mistake

An admin key for an internal LiteLLM test platform lands in a public repository. It is deleted three hours later but never revoked.

Record

The key is used

The attacker uses it to reach a GitHub token, then more tokens from other maintainers.

Official

Poisoned release goes out

Seven wheels (the install files) reach PyPI. Docker images follow at 11:46 UTC.

Official

PyPI removes it

GHCR tags were gone by 13:51 UTC. Docker Hub tags were removed or repointed at 14:20 UTC.

Official

Microsoft and CERT-In publish details

Both name the malicious files and give the same clean version.

How the malware works#

The wheel carried three extra files that land in Python's site-packages folder, not in the litellm folder. That is why deleting litellm alone does not help.

FileWhat it does
cook.pthOne line, import cook. Python runs it at every start
cook.pyThe hidden stealer, named PRIVCOLLECT
sitecustomize.pyAnother collector plus a loader for more code (Unix only)

According to Microsoft it looks for cloud and Kubernetes credentials, SSH and GPG keys, .env files, Git and Docker credentials, browser data, AI tool tokens and, on a LiteLLM proxy, the stored provider keys in the database. It sends the loot to www[.]litellm[.]dev (written with brackets so nobody clicks it). That is not LiteLLM's real site.

Science cornerWhat is a startup hook?

Python has two places where code runs before your program starts: any .pth file with an import line, and a file called sitecustomize.py. They exist for legitimate setup. The attackers used them so the malware needs no help from you. Starting python, running pip or launching a script all trigger it.

Where the sources disagree#

  • Root cause. LiteLLM's first post (21 Oct) guessed that tokens leaked from an internal LiteLLM deployment's logs. Its later post (23 Oct) calls itself "the canonical source of truth" and blames the committed admin key. Microsoft said it had not determined how the attacker first got in.
  • How to check. LiteLLM lists pip show litellm. Microsoft says not to run Python or pip in a suspect environment. We put a safe file search first.
  • Windows. A Windows wheel existed, but the sources describe the collector as Unix-oriented. We could not confirm what it did on Windows. Treat it as affected.

Am I affected?#

What you ranAffected?
pip install litellm (no version) on 21 Oct, 11:39 to 13:23 UTCYes, if you got 1.107.0
Docker tag latest, main-latest or main-stable started 21 Oct, 11:46 to 14:20 UTCYes
Docker tag v1.107.0 at any timeYes
Any pinned version below 1.107.0No, per LiteLLM
LiteLLM Enterprise private registryNot affected, per LiteLLM

What to do now#

Work from a different, clean computer for steps 4 and 5.

Step 1. Cut it off. Stop the LiteLLM container or service and block outbound traffic from that host if you can. If you run Pi-hole or AdGuard Home, search its query log for litellm.dev. Keep logs: CERT-In says to preserve evidence before you kill anything.

Step 2. Look for the bad files without running Python.

Linux#

Run in terminalbash
find / -type d -name 'litellm-1.107.0.dist-info' 2>/dev/null
find / \( -name cook.pth -o -name cook.py \) 2>/dev/null
ls -l /tmp/remote_code_loader.lock /tmp/.pc_once_* 2>/dev/null

Expected on a clean machine: no output. Any hit means affected. Some systems ship a harmless sitecustomize.py, so a hit on that name alone is not proof. Compare its SHA-256 with the hashes Microsoft lists for the Linux and Mac files (the Windows files have different hashes in Microsoft's post):

Run in terminaltext
cook.pth           7f191632e7320705d154b85204f1ae546b543acbd7e8861229b76f5042b92bdb
cook.py            9dd0a3926f96a37eb86cf1ee2310d9be93139cc4ebef3ef9e2efe9531390be25
sitecustomize.py   34bef04fe88ac9d0aae0475630b1738681d15b94f233ac8aa46eacf5968305fa
Run in terminalbash
sha256sum /path/to/site-packages/cook.pth

Windows#

Open PowerShell. Search your user folder and your Python install folders (dummy path, use your own):

Codepowershell
Get-ChildItem -Path $env:USERPROFILE, 'C:\Python312' -Recurse -Include cook.pth,cook.py,'litellm-1.107.0.dist-info' -ErrorAction SilentlyContinue | Select-Object FullName

Expected on a clean machine: nothing printed. To compare a hash: Get-FileHash .\cook.pth -Algorithm SHA256.

Mac#

Run in terminalbash
find / -type d -name 'litellm-1.107.0.dist-info' 2>/dev/null
find / \( -name cook.pth -o -name cook.py \) 2>/dev/null

Expected: no output. Compare hashes with shasum -a 256 /path/to/cook.pth.

Docker#

Run in terminalbash
docker images --digests | grep -i litellm
docker image inspect --format '{{json .RepoDigests}}' ghcr.io/berriai/litellm:latest

If any digest starts with sha256:1bbcb1443bc9, that is the poisoned image. Also compare when the image was pulled with 21 October. A container that was started from the bad image keeps running it even after you pull a new one, so list your containers too:

Run in terminalbash
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.CreatedAt}}'

These Docker commands work the same on Linux, Windows and Mac. In Windows PowerShell replace grep -i litellm with Select-String -Pattern litellm. Image names here are examples. Use the names from your compose file.

Step 3. Rebuild, do not patch. The simplest safe route: delete the whole virtual environment or container and the Docker image, then build again from a clean source. Do not start with pip install, because that runs the malware again. If you cannot rebuild yet, LiteLLM's emergency steps are: delete cook.pth, cook.py, sitecustomize.py and the matching __pycache__ files from every affected site-packages, and stop the hidden Python process that holds /tmp/remote_code_loader.lock (on Linux: sudo fuser -v /tmp/remote_code_loader.lock).

Step 4. Rotate everything that host could read. From a clean machine, in this order:

  1. Provider keys (OpenAI, Anthropic and so on), including those stored inside the LiteLLM database.
  2. The LiteLLM master key, virtual keys and DATABASE_URL password. CERT-In also lists the salt_key. Check LiteLLM's docs before changing it (we did not).
  3. Cloud keys, SSH and GPG keys, Git and Docker registry tokens, and any secret in an environment variable on that host.
  4. Browser sessions and AI tool tokens. Revoke sessions, not just passwords.

Then look at each provider's usage page for calls you did not make.

Step 5. Pin a clean version. LiteLLM and CERT-In name 1.106.2. PyPI shows it was uploaded at 10:44 UTC on 21 October, before the attack. Newer releases exist (1.112.1 on 2 December); we did not audit them. On 4 December the Docker Hub tag main-latest no longer pointed at the bad digest, but a floating tag can change again. Pin exactly, never "latest":

Run in terminalbash
pip install "litellm==1.106.2"

For Docker, pin a version tag and then the digest. Dummy digest shown, use your own from docker image inspect:

File contentyaml
image: ghcr.io/berriai/litellm@sha256:0000000000000000000000000000000000000000000000000000000000000000

Common mistakes#

MistakeWhy it happensDo this instead
Deleting the litellm folder and moving onThe malware sits next to it in site-packagesRebuild the environment, then rotate keys
Running pip install firstIt feels like the normal fixDelete the bad files first; pip starts Python
Changing keys from the infected hostIt is the machine at handRotate from a clean computer
Trusting a green signatureThe bad 1.107.0 images carried a valid signature from the old keyCompare the digest
Asking an AI assistant for the "LiteLLM CVE"Assistants invent numbersNo CVE appears in our sources. An assistant may also suggest latest or 1.107.0

Removing the package or a release tag is not sufficient recovery.

MicrosoftSecurity blog, 23 Oct 2026

Our take#

One gateway holds the keys to many paid services, so home labs are a natural target. The failure was ordinary: a key committed in May that nobody revoked. Pin exact versions or digests, limit outbound traffic from the gateway, and set spending limits at your AI providers so a stolen key costs little.

Sources#

Checked on 4 December 2026. Primary sources first.

  1. Contained: Oct 21, 2026 LiteLLM release v1.107.0 Compromised - LiteLLM, 21 Oct 2026 (updated to 15 Nov)
  2. The attack chain behind the v1.107.0 LiteLLM release - LiteLLM, 23 Oct 2026
  3. Inside the LiteLLM 1.107.0 supply chain compromise - Microsoft Security Blog, 23 Oct 2026
  4. CERT-In advisory CIAD-2026-0053 - CERT-In, 23 Oct 2026 (page updated 4 Dec 2026)
  5. litellm release list - PyPI, checked 4 Dec 2026

Try one of these