LiteLLM 1.107.0 Was Compromised: How to Check, Clean Up and Rotate Keys
LiteLLM 1.107.0 on PyPI and Docker carried a credential stealer on Oct 21, 2026. How to check for it without starting Python, and which keys to rotate.

If you installed litellm 1.107.0 from PyPI, or ran LiteLLM's Docker images tagged v1.107.0, latest, main-latest or main-stable on October 21, 2026, LiteLLM says to treat that environment as compromised (LiteLLM incident post). Clean it up without starting Python, rebuild pinned to 1.106.2, and rotate every credential the machine could reach. If you never had 1.107.0, LiteLLM says all earlier versions are safe.
What happened?
LiteLLM's release pipeline published a malicious 1.107.0. These are the exposure windows LiteLLM gives (all October 21, UTC):
- PyPI:
litellm==1.107.0, all seven wheels, live from 11:39 to 13:23 (4:39 to 6:23 AM PT). - Docker Hub: v1.107.0, latest, main-latest and main-stable pointed at the bad image from 11:46 to 14:20.
- GHCR: the same tags, from 11:46 until they were made unavailable by 13:51.
The package dropped three files into site-packages: cook.pth, cook.py and sitecustomize.py. Python runs these at startup, so Microsoft's analysis notes that just starting Python in that environment could run the payload, even if nothing imported LiteLLM. In one example Microsoft saw, an ordinary pip install of an unrelated package set it off.
The payload went after AI and developer tool configs, cloud credentials, SSH keys, environment variables, browser data and the credentials stored in the LiteLLM proxy database.
How did attackers get in?
This is the part worth remembering. LiteLLM's root cause post says an admin key for an internal LiteLLM service was committed to a public repo on May 27. The file was deleted about three hours later, but the key stayed in git history and was never revoked.
On October 10 the attacker used that key to pull a GitHub CLI token belonging to a GitHub organization owner. From there they got two more maintainers' tokens, which were stored as CI secrets. On October 21 they used those tokens to point the release workflow at a lookalike fork (Berri-AI/litellm) and approve the release.
In LiteLLM's words, the incident "provided a strong illustration of the risks associated with failing to rotate a potentially exposed key." If you ever commit a key, deleting the file doesn't make the key safe. Revoking it does.
How do I check if I'm affected?
Don't run pip or python inside an environment you suspect. Microsoft advises checking from a trusted shell or a clean machine instead.
- Search lock files, requirements files, uv and pip caches, internal mirrors and image builds for litellm 1.107.0.
- Look in each site-packages folder for
litellm-1.107.0.dist-info,cook.pth,cook.pyorsitecustomize.py. Finding one confirms exposure. Not finding one doesn't prove the environment is clean. - For containers, check whether you ran image digest
sha256:1bbcb1443bc962e45f5aad53fe3d2c30600e0379715fb6c664cdd3ac126c339e.
What to do now
These steps follow LiteLLM's incident post, in its order:
- From the shell, delete
cook.pth,cook.py,sitecustomize.pyand any matchingcook*.pycandsitecustomize*.pycfiles in__pycache__, from every affected site-packages. - Kill the background Python process holding
/tmp/remote_code_loader.lock. - Rebuild the environment or image from scratch, pinned to
litellm==1.106.2. LiteLLM says rebuilding beats cleaning in place. - From a clean machine, rotate everything the host could reach: the instance or task cloud role, every provider key stored in the LiteLLM proxy database, the LiteLLM master and virtual keys, the
DATABASE_URLpassword, and any secret in any process environment on that host. - On AWS, check CloudTrail for
GetCallerIdentitycalls from the instance role around install time, then for any use of that role's credentials from outside your infrastructure.
If the host had outbound internet, LiteLLM says to assume the data left.
How do I avoid the next one?
From Microsoft's guidance: use hash-pinned lock files, pull container images by digest instead of floating tags like latest, and limit outbound network access from build and AI gateway hosts. For your own GitHub automation, a fine-grained personal access token scoped to specific repos limits what a leak can do. LiteLLM notes that the CLI token that started its chain wasn't scoped.
What is still unknown
LiteLLM says parts of its first incident post turned out to be wrong, and it calls the October 23 attack-chain post the source of truth. It said it would share process changes the following week. Microsoft says the remote code loader's second stage wasn't confirmed to have run. Neither source can tell you what was taken from your particular machine.
FAQ
I never imported LiteLLM in my code. Am I safe?
Not if 1.107.0 was installed in that environment. The startup files run whenever Python starts there.
Is uninstalling litellm enough?
No. Microsoft notes the startup files sit outside the litellm package folder, so removing the package can leave them behind. Rebuild instead.
Which version should I use now?
LiteLLM's incident post says to pin 1.106.2. PyPI also lists 1.106.3 to 1.106.6, and LiteLLM says releases from October 24 onward are signed with its new image signing key.
Were enterprise customers affected?
LiteLLM says customers pulling from its private enterprise registry weren't affected.
Press ⌘K. Every dashboard, one keystroke away.