LiteLLM 1.107.0 Backdoored: How the .pth Stealer Worked
TL;DR · the short version
LiteLLM — a very widely used open-source LLM gateway/proxy — had its release pipeline compromised on 21 October 2026. Malicious v1.107.0 artifacts were published to PyPI (all seven wheels), Docker Hub and GHCR (tags v1.107.0, latest, main-latest, main-stable) for a window of roughly two hours before being pulled. The official v1.107.0 git tag was clean: the bad wheels were built from an attacker-controlled source, i.e. the build pipeline, not the code, was subverted. The payload is the notable part: a cook.pth file that abuses Python’s .pth startup mechanism, so the stealer executed at interpreter startup without litellm ever being imported, and harvested cloud credentials, AI provider API keys, and SSH/GPG keys, exfiltrating to the look-alike domain www.litellm.dev (the real project is litellm.ai). Reports also describe a backdoor able to fetch and run more code. Remediation per the project and researchers: pin to the last known-good v1.106.2, rebuild any affected host or container, and rotate every secret those deployments could read. Enterprise deployments that pull only from a private registry are unaffected.
GH_TOKEN and RELEASE_PLEASE_TOKEN secrets) to webhook.site. On 21 Oct they repointed the release workflow at a look-alike fork (Berri-AI/litellm, commit 20535d8f) by overriding branch protection with the owner token, triggered the build with one stolen token, approved the production gate with another, then deleted the run records and force-pushed main clean to hide it. A community researcher flagged the malicious release within ~20 minutes. The defender lesson is almost entirely about GitHub blast radius: rotate exposed keys for real, scope tokens, lock release workflows to a source you control, and alarm on branch-protection overrides and force-pushes. Facts attributed to LiteLLM’s published RCA.On 21 October 2026, one of the most widely deployed open-source LLM gateways was turned into a credential stealer for about two hours. Malicious LiteLLM 1.107.0 artifacts were published to PyPI, Docker Hub and GHCR, and the payload did something worth every security team’s attention: it ran at Python startup, before LiteLLM was ever imported, and shipped your cloud, AI, SSH and GPG keys to a look-alike domain. This is the second supply-chain hit on LiteLLM in 2026, and the mechanism is a clean teaching case.
Independent, docs-grounded analysis for security & engineering leaders, based on LiteLLM’s official advisory and GitHub issue plus corroborating research (Socket, Wiz, Endor Labs, Upwind, The Hacker News). PlayCISO is not affiliated with LiteLLM/BerriAI. We name no individual as the attacker — the project is the victim of a pipeline compromise; the investigation into the entry vector is ongoing.
The incident in plain words
What: malicious litellm==1.107.0 wheels (all seven) on PyPI, plus Docker Hub/GHCR images tagged v1.107.0, latest, main-latest, main-stable. Published ~04:40 PDT, detected ~06:32 PDT, removed shortly after.
How: a build-pipeline compromise, not a source change — the official v1.107.0 git tag is clean; the bad wheels were built from an attacker-controlled repository.
Payload: a cook.pth file that executes at Python interpreter startup (no import of litellm required), stealing cloud credentials, AI provider keys and SSH/GPG keys and exfiltrating to the look-alike www.litellm.dev (official project is litellm.ai); a loader/backdoor for further code was also reported.
The clever, nasty part: execution without import
Most people reason about dependency risk as "the code runs when I call it." The .pth mechanism breaks that assumption. Python processes .pth files in site-packages during interpreter startup, and any line starting with import is executed immediately. By dropping a cook.pth, the attacker guaranteed the stealer fired the instant any Python process started in that environment — a cron job, a health check, a totally unrelated script — whether or not anything ever imported litellm or started the proxy. "We installed it but never used it" is therefore not a safe position for this incident. It is the same lesson as malicious npm postinstall scripts: installation itself is code execution.
Useful next, if this was relevant to you
Why the pipeline, not the code
The public source for v1.107.0 was fine. The artifacts were not. That gap — trusted Git tag, poisoned published wheel — is the signature of a release-pipeline compromise, and it is exactly why signing and provenance matter: if your build emits signed artifacts with verifiable provenance (who built it, from which commit, on what runner), a wheel built from an attacker-controlled repo fails verification before it ever reaches a developer or a container. Reproducible builds and pinned, hash-verified dependencies close the same gap from the consumer side.
What a security team should do now
- Pin to v1.106.2 — the last release before the compromised one — and hash-pin it.
- Find exposure. Any
pip install litellm==1.107.0or pull of the affected image tags in the window (~04:40–06:40 PDT / ~11:40–13:40 UTC on 21 Oct; floating Docker tags lagged the takedown, so treat slightly later pulls as suspect) is in scope. - Rebuild, do not just uninstall. The
.pthmay have already executed, so an in-place uninstall does not restore trust — rebuild the host or container from clean, verified sources. - Rotate everything the environment could read: cloud provider keys, AI provider API keys, SSH and GPG keys, and any LiteLLM proxy master key. Treat them as exposed, not "possibly exposed."
- Hunt the IOCs: researchers cite the files
/tmp/.pc_once_*and/tmp/remote_code_loader.lock, and outbound connections towww.litellm.dev. Egress monitoring would have flagged that exfiltration domain — a reminder that default-deny egress on build and inference hosts is a real control, not a nicety.
The standing lesson for AI platform teams
AI tooling has become critical path, and it carries the same supply-chain risk as any other dependency — arguably more, because gateways and proxies sit on top of your most sensitive secrets (every model key, every cloud credential) — the same credential-aggregation risk that drained developer keys in the OpenCode console breach. The durable defenses are unglamorous and they work: pull from a vetted private registry (the enterprise deployments doing this were unaffected here), pin and hash-verify versions, require artifact signing and provenance, keep an inventory of what you actually run, and put egress controls around build and inference hosts so a stealer cannot phone home. This was LiteLLM’s second supply-chain incident of the year; the teams who treated the first one as a system to fix, not a one-off, had far less to do this morning.
Put it to work
We build tools around exactly these controls (Pro; a free account includes 3 runs):
- Release Pipeline Integrity Scorecard — score your build/release pipeline against the weaknesses this incident exploited (provenance, signing, reproducibility, registry trust).
- AIBOM generator — an AI Bill of Materials so you actually know which services run which AI components and versions when the next advisory drops.
- Context from the earlier hit: The LiteLLM TeamPCP attack, and the pipeline-integrity angle from the OVHcloud CLI compromise.
Follow the official LiteLLM advisory and GitHub issue #47826 for the authoritative, continuously-updated remediation steps and the ongoing root-cause investigation.
Frequently asked questions
What exactly was compromised?
LiteLLM’s release/build pipeline. On 21 October 2026 malicious v1.107.0 artifacts appeared on PyPI (all seven wheels of litellm==1.107.0), Docker Hub and GHCR (the v1.107.0, latest, main-latest and main-stable image tags). The LiteLLM project states the official v1.107.0 git tag does not contain the malicious files — the bad wheels were built from an attacker-controlled repository, so this was a build-pipeline compromise, not a change to the public source. The releases and images have been removed. PlayCISO is relaying the project’s own advisory and independent researchers; we are not affiliated with LiteLLM/BerriAI.
Why is the .pth payload a big deal?
The stealer shipped as a file named cook.pth. Python automatically processes .pth files in site-packages at interpreter startup, and any line beginning with "import" is executed. That means the malicious code ran the moment a Python process started in that environment — you did NOT have to import litellm, run the proxy, or call any API for it to fire. It is a quiet, import-independent execution primitive, which is why "we only installed it, we never used it" is not a safe assumption here.
What did it steal, and where did it send it?
Researchers report it harvested cloud provider credentials, AI provider API keys, and SSH and GPG keys, then exfiltrated them to www.litellm.dev — a look-alike domain unrelated to the official litellm.ai. Some analyses also describe a backdoor/loader able to pull and execute additional code. Treat any secret readable by an affected host or container as exposed.
What should we do right now?
Pin to v1.106.2, the last version before the compromised release. Find any install or image pulled in the exposure window (roughly 04:40–06:40 PDT / ~11:40–13:40 UTC on 21 Oct 2026; some floating Docker tags lagged the takedown, so treat pulls shortly after as suspect too). Rebuild those hosts/containers from clean sources rather than trusting an in-place uninstall — the .pth may have already run. Rotate every credential the environment could read: cloud keys, AI provider keys, SSH and GPG keys, proxy master keys. As IOCs, researchers list the files /tmp/.pc_once_* and /tmp/remote_code_loader.lock. Follow the official advisory and GitHub issue for the authoritative, updated steps.
Who is unaffected?
Per the project, enterprise deployments that pull LiteLLM only from their own private registry (not public PyPI/Docker Hub/GHCR during the window) are unaffected. That is itself the lesson: a vetted internal registry plus pinned, hash-verified versions turns an ecosystem-wide incident into a non-event for you.
Spotted an error? Report an error. A person reads every message.