LiteLLM Supply Chain Attack: How 1.107.0 Was Compromised, and How to Check
On 21 October 2026, LiteLLM 1.107.0 went out on PyPI and Docker Hub with a credential stealer inside, the second compromise this year. LiteLLM has since published the root cause: an admin key committed to a public repository in May and never revoked. Here is how to check your machines and images, what to rotate, and what we found in our own stack.
Oct 23, 2026
On 21 October 2026, LiteLLM 1.107.0 was published to PyPI and to Docker Hub and GitHub's container registry with compiled malware that steals credentials and loads remote-code tools. The PyPI release was live from 11:39 to 13:23 UTC, and the latest, main-latest and main-stable Docker tags pointed at the bad image until 14:20 UTC (LiteLLM's incident report). Wiz counts roughly 49,000 downloads of the malicious version (Wiz). It is LiteLLM's second supply chain attack this year, after versions 1.82.7 and 1.82.8 in March. If 1.107.0 ran anywhere, removing it is not enough: rebuild and rotate. The way in, per LiteLLM's root cause analysis of 23 October, was an admin key committed to a public repository on 27 May and never revoked.
Check in 30 seconds (on each machine, image and CI runner with Python):
pip show litellm 2>/dev/null | grep -i '^version' # 1.107.0, 1.82.7 or 1.82.8 = affected
grep -rnE 'litellm[^0-9]*(1\.107\.0|1\.82\.[78])' uv.lock poetry.lock requirements*.txt 2>/dev/null
python -c "import site,os;[print(p) for d in site.getsitepackages() for p in ('cook.pth','sitecustomize.py') if os.path.exists(os.path.join(d,p))]"
Any hit means: rebuild, then rotate (steps below). We run LiteLLM in production; further down is what we found when we checked our own stack.
What happened on 21 October
LiteLLM's own timeline, all times UTC:
| Time | Event |
|---|---|
| 10:08 | A privileged developer credential overrides branch protection and changes the release workflow |
| 10:46 | A staging run builds from a lookalike repository, Berri-AI/litellm |
| 11:11 | A second developer credential approves the production release |
| 11:39 | Seven malicious 1.107.0 wheels uploaded to PyPI |
| 11:46 | Malicious images published to Docker Hub and GHCR |
| 11:53 | A third credential deletes the workflow records |
| 13:23 | PyPI removes 1.107.0 |
| 14:20 | All affected Docker Hub tags removed or repointed to clean images |
The official v1.107.0 source tag on GitHub does not contain the malicious files. The packages were built from the attacker's copy. Datadog and SOCRadar report stolen AWS credentials already being used afterwards (Datadog, SOCRadar). The malicious release was first flagged publicly at 12:06 UTC in GitHub issue #47826.
How the attackers got in
LiteLLM's root cause analysis, published 23 October, replaces the provisional account in its first notice:
- 27 May: a config file committed to the public
LiteLLM-Labs/lite-harnessrepository contained an administrative key to an internal LiteLLM Agent Platform deployment. The file was deleted about three hours later, but the commit stayed in public history until 22 October, and "because of human error, nobody followed through on revoking the administrative key." - 10 October: the attacker used the key. One API call listing managed agents returned their configuration, including the GitHub CLI OAuth token of the GitHub organization owner. CLI tokens are unscoped, so that meant owner access to the whole organization.
- 10 and 12 October: throwaway CI workflows on LiteLLM's repositories posted repository secrets to an outside webhook, including the GitHub CLI tokens of two more maintainers.
- 21 October: the owner's token pushed a change to the release workflow past branch protection, letting it build from a fork. A second maintainer's token approved the production gate. LiteLLM notes the rule had been relaxed earlier that week so that any two engineers could trigger and approve a release.
The lesson for everyone else is not about PyPI. A key pasted into a config file, removed from the latest commit but never revoked, sat valid for almost five months. And an AI agent platform stored an unscoped owner token in its configuration, where any admin-key holder could read it. Both are common in companies building with AI agents. If you have ever committed a key and deleted it, it is still in your history: revoke it.
Indicators from the analysis: IPs 69.48.229.143 (10 October) and 199.91.221.39 (21 October), the lookalike organization Berri-AI, fork commit 20535d8f, workflow commit 9cf97e9, and temporary branches ci-tmp-a351cc and ci-tmp-be33e9.
Affected artifacts:
- PyPI:
litellm==1.107.0, all seven wheels. - Docker Hub and GHCR: the tags
v1.107.0,latest,main-latestandmain-stable, including thelitellm-databaseandlitellm-non_rootimages on GHCR. - Not affected: enterprise customers on LiteLLM's private registry, and every version before 1.107.0.
March and October: two attacks, one lesson
| March 2026 | October 2026 | |
|---|---|---|
| Versions | 1.82.7, 1.82.8 | 1.107.0 |
| Where | PyPI | PyPI, Docker Hub, GHCR |
| How | Stolen PyPI publishing credentials, reportedly via the compromised Trivy scanner in CI | A leaked, never-revoked admin key led to maintainers' GitHub tokens; release pipeline pointed at a lookalike repository |
| Payload | Harvester for SSH keys, cloud credentials, Kubernetes secrets, .env files | Compiled credential stealer plus remote-code loader |
| Live for | Three to five hours, by reports | 1 h 44 on PyPI, about 2.5 h on Docker Hub |
Both times, the source code on GitHub was clean and the published package was not. Reading the code before upgrading would not have caught either one. What protects you is not installing a new version the hour it comes out, and never letting a production build pull a floating tag like latest. We covered the March incident, and LiteLLM's separate MCP authentication flaw, in our LiteLLM vulnerability post.
How to check whether you are affected
- Lockfiles and CI logs. Search
uv.lock,poetry.lock,requirements*.txtand build logs forlitellm1.107.0(and1.82.7or1.82.8). - Running environments.
pip show litellmon every machine and image that has Python. - Containers. Did anything pull
litellmwith thelatest,main-latest,main-stableorv1.107.0tag on 21 October? Check pod and deployment history, not just what runs today. - Markers. LiteLLM lists
litellm-1.107.0.dist-info,cook.pthandsitecustomize.pyin site-packages. Finding them confirms exposure. Not finding them does not prove the machine is clean. - Indirect installs. Developer tools, notebooks, coding agents, MCP plugins and AI code review bots often bundle LiteLLM. Check what they installed on 21 October too.
If 1.107.0 ran: clean up in this order
From LiteLLM's remediation steps:
- Do not start with
pip install. The malicious files run again every time Python starts. - Rebuild the environment or image from scratch, pinned to
litellm==1.106.2or another explicit earlier version. If you must clean in place, removecook.pth,cook.py,sitecustomize.pyand their compiled.pycfiles, and stop the background Python process holding/tmp/remote_code_loader.lock. - Assume data left the machine if it had outbound internet access.
- Rotate what the host could reach: the instance or task cloud role, every model provider key stored in the proxy database, master and virtual keys, the
DATABASE_URLpassword, and any secret in the process environment. - Look for reuse. In AWS, check CloudTrail for
GetCallerIdentitycalls from the instance role around install time, and for those credentials being used from outside your infrastructure. Check your logs for the two IPs in the analysis above.
Is LiteLLM safe to use now?
The bad artifacts are gone: PyPI pulled 1.107.0 on 21 October. The first release since, 1.108.0, went out on 4 November (03:31 UTC). When we checked that day, PyPI showed no provenance attestation for its wheels, so there is no independent way yet to tell it was built from the tagged source.
What LiteLLM has changed, per its 30 October post:
- Done: the release approval gate is held by one dedicated account, tied to one device in its office. Owner accounts are separate from day-to-day accounts and may not use tokens, OAuth apps, the API or
gh. - Planned for 31 December 2026: a verifier running outside GitHub that downloads every published wheel, sdist and image, compares them to the tagged source and alerts on any mismatch.
- Planned for 31 January 2027: automations moved to GitHub Apps or fine-grained, expiring tokens, and repository secrets limited to protected branches.
- Trusted Publishing and cosign-signed images date from after March. LiteLLM itself says they did not stop October, because an organization owner could still change the pipeline.
The habits that kept us safe both times are what make it safe to keep using:
- Pin an explicit version in a lockfile (1.106.2 is the last release before the incident), and an explicit image tag or digest for the proxy. Never
latest. - Wait a few days before adopting a release, 1.108.0 included. Both compromised versions were pulled within hours of going out.
- Keep the proxy's model keys scoped and rotatable, so a compromise costs a rotation, not a weekend.
If you are weighing a move instead, we compared the options, with license, cost and whether their releases can be verified, in LiteLLM alternatives.
What we found in our own stack
We checked two places where LiteLLM runs in our infrastructure:
- Our AI service calls models through the LiteLLM library. It installs from a lockfile that has pinned 1.90.2 since 3 July 2026, and that lockfile has not changed since. 1.107.0 was never installed.
- Our self-hosted AI code review bot bundles LiteLLM as a dependency, version 1.81.12, inside an image we mirrored from Docker Hub on 3 June 2026 and pin by tag. It never pulls
latest, so it never saw the bad image. - The March attack did not reach us either. Our AI service's lockfile had LiteLLM pinned at 1.80.0 throughout March, so 1.82.7 and 1.82.8 were never installed. On 10 April we moved to 1.83.4 and set the minimum to
>=1.83.0, with a comment in the dependency file saying it skips the compromised versions.
Neither result is luck exactly. A lockfile, a pinned image tag and nobody upgrading on the day of a release are boring habits. They are also the whole defence against this class of attack, because the code everyone reads on GitHub was clean both times.
What we have not done: we do not run the LiteLLM proxy, so we cannot speak to cleaning one from experience. The steps above are LiteLLM's.
Related: the LiteLLM MCP vulnerability (CVE-2026-59822), AI agent security, MCP security in 2026, and our security page.