LiteLLM's Poisoned 1.107.0 Release Started With GitHub Tokens in Its Own Gateway Logs
By AgentRiot Editorial
Malicious LiteLLM wheels and Docker images were live for about two hours on October 21. LiteLLM says the attacker pulled developers' GitHub CLI tokens from the logs of an internet-exposed internal LiteLLM deployment, then used them to hijack the release pipeline.

Update, 8:59 AM ET, October 24: On the incident GitHub thread (opens in new tab), LiteLLM contributor ojensen-berri said the company is "actively working with Anthropic to identify how and why this happens" when Claude Code puts GitHub CLI tokens in response bodies, and that this "did not turn out to be the mechanism by which the threat actor acquired the GitHub auth tokens." He also walked back the first post's "recently patched vulnerability" suspicion, writing that he "did not have a specific vulnerability in mind" and that the unexpected user on the internal gateway was added with credentials the attacker already had. Anthropic has not published a statement.
Update, 5:44 AM ET, October 24: LiteLLM published v1.106.3 (opens in new tab) on GitHub at 09:34 UTC and uploaded it to PyPI (opens in new tab) at 09:14 UTC, and that cut is now latest (opens in new tab). The notes say it backports the eMudhra root-CA removal and the new Docker/Helm cosign key first shipped in 1.103.8, with matching cuts on 1.105.4 (opens in new tab) and 1.104.6 (opens in new tab). 1.107.0 is still absent.
Update, 4:32 AM ET, October 24: LiteLLM published v1.103.8 (opens in new tab) on GitHub at 08:11 UTC and uploaded it to PyPI (opens in new tab) at 07:56 UTC. The notes say the cut backports the eMudhra root-CA removal the company said it would ship by end of day October 23, and that Docker and Helm images from this release are signed with a new cosign key. PyPI latest (opens in new tab) is still 1.106.2, and 1.107.0 is still absent.
Update, 6:51 PM ET, October 23: Socket (opens in new tab) recovered a second secret-stealing GitHub Actions workflow in BerriAI/litellm on October 12, two days after the October 10 throwaway run LiteLLM documented. Socket says the two workflows referenced 20 distinct secret names, including a GitHub App private key, a GitGuardian API key, LLM provider keys, and environment-scoped database credentials, and that the two secret sets do not overlap. It has not confirmed the collectors received those values, and it does not itself claim the October 10 theft produced the access used on October 21.
Update, 5:45 PM ET, October 23: LiteLLM published a completed investigation (opens in new tab) of how v1.107.0 was published. It now says the first stolen credential was a GitHub organization owner's CLI token, returned by LiteLLM Agent Platform after a master key committed to a public repository in May was never revoked, not tokens taken from internal gateway logs. The company says this post is the canonical account where it disagrees with earlier status updates.
Update, 2:26 PM ET, October 23: Microsoft Threat Intelligence (opens in new tab) published an analysis of the 1.107.0 wheels. It says endpoint observations on Windows and macOS matched the credential collector's discovery, encryption, and outbound connections, including a Windows case where installing an unrelated Python package started the collector. Microsoft says it has not independently determined how the attacker first obtained the GitHub credentials, and that second-stage remote code retrieval was not confirmed.
On Wednesday, October 21, a malicious litellm==1.107.0 landed on PyPI and in LiteLLM's official Docker images. It carried a credential stealer that runs every time Python starts, plus a loader built to fetch and run more code later. LiteLLM is the open-source gateway many teams put between their apps and OpenAI, Anthropic, Bedrock and other model providers, so the machines running it tend to hold exactly the keys an attacker wants.
LiteLLM's completed investigation says the attacker used three engineers' GitHub CLI OAuth tokens to hijack the release pipeline. The first of those tokens, it now says, came from LiteLLM Agent Platform, an experimental service the company used to orchestrate self-hosted agents that file GitHub pull requests. A master key for that service was committed to the public LiteLLM-Labs/lite-harness repository on May 27. LiteLLM says the error was spotted and the commit was force-pushed over, and that the key was identified as requiring revocation, but revocation did not occur. On October 10, the attacker used that key against the Agent Platform API and received the GitHub CLI OAuth token of a GitHub organization owner. LiteLLM says that token was not tied to a service account, was not scoped down, and, because it was a GitHub CLI token, was not subject to GitHub's extra 2FA reauth for sensitive organization actions.
The original incident post (opens in new tab) had said the tokens were sitting in the logs of an internet-exposed internal LiteLLM deployment, after Claude Code embedded GitHub CLI tokens in response bodies. The completed investigation walks that back: "Our first post suspected the tokens were taken from the logs of an internal LiteLLM deployment. The request logs show the first token came from a different service."
What shipped, and for how long
All times below are UTC on October 21, from LiteLLM's post.
- PyPI: all seven
litellm==1.107.0wheels were malicious, uploaded between 11:39:51 and 11:40:13. PyPI had removed the version by 13:23. - Docker Hub: the
v1.107.0,latest,main-latestandmain-stabletags pointed to the compromised image from 11:46:56 until 14:20, when they were removed or repointed to clean builds. - GHCR: the same four tags on
ghcr.io/berriai/litellm,litellm-databaseandlitellm-non_rootserved compromised images from 11:46:56 until they were made unavailable by 13:51.
LiteLLM says all earlier versions are safe, and that enterprise customers pulling from its private registry were not affected. The original incident post said the official v1.107.0 source tag on GitHub never contained the malicious files. On October 24 a maintainer said there is no official v1.107.0 source tag and that LiteLLM will skip that version. The last pre-incident public cut is 1.106.2. After the pause, PyPI latest (opens in new tab) is 1.106.3, whose notes describe an eMudhra CA removal and a rotated image-signing key. 1.107.0 is still absent.
The window was short, but the floating tags made it wide. Anyone whose deployment pulled latest or main-stable during those two and a half hours got the stealer without choosing a new version. Wiz (opens in new tab), citing ClickPy data, puts PyPI downloads of the malicious version at about 49,000. Datadog Security Labs (opens in new tab) describes LiteLLM as having about 23 million weekly downloads.
How the attacker got in, by LiteLLM's account
LiteLLM says it had already rebuilt its release process after an earlier compromise in March. Releases moved to a private repository and publish through Trusted Publishers, Docker release tags were made immutable, and images are signed. Publishing, it says, "can only be performed by an account locked to a specific laptop physically located within our office at all times."
None of that held, because the attacker already had three engineers' GitHub tokens. The sequence LiteLLM now describes:
- On May 27, a master key for LiteLLM Agent Platform was committed to a public repository and never revoked. On October 10, the attacker used it to pull a GitHub organization owner's CLI token from that service, then used the owner's token to run throwaway CI workflows that posted two more maintainers' GitHub CLI tokens. Socket (opens in new tab) independently recovered that October 10
BerriAI/litellmworkflow and a second workflow on October 12 that bound five GitHub Environments to collect a different set of secrets the first run could not reach. - On Monday, October 19, LiteLLM temporarily widened release permissions so two engineers could publish daily bugfix backports for customers.
- At 10:08:29 UTC on October 21, branch protection rejected an unauthorized change to the private release workflow. Five seconds later, the organization owner's token was used to override the protection and force the change through. LiteLLM says the attacker first tried to merge the change with a second maintainer's token and only used the noisier owner override after that was rejected.
- The modified workflow built from a lookalike repository,
Berri-AI/litellminstead ofBerriAI/litellm. At 11:11:18, the second maintainer's token satisfied the production approval gate. - The pipeline signed and published the poisoned artifacts. At 11:53, a third maintainer's token was used to delete the production and staging workflow records. The owner's token then reverted the workflow change and force-pushed
mainso neither the change nor the revert remained in the visible history.
Wiz traced the attacker's commits in the lookalike repository: 10 commits between 08:56 and 10:46 UTC that added three startup files, bumped the version to 1.107.0, added one line to pyproject.toml that told the build tool to bundle the payload into the wheel, and finally copied it into the Dockerfiles.
The signing worked as designed. It signed whatever the hijacked workflow built.
Where the tokens came from
LiteLLM's first incident post offered a different origin story. It said Claude Code will, in "specific situations," embed a user's GitHub CLI OAuth token in a response body, and that those tokens appeared in the logs of an internet-exposed internal LiteLLM deployment. It found "an unexpected, innocuously named user account" in that deployment and believed the attacker read the tokens out of its logs. How the attacker got into the deployment was not confirmed. LiteLLM "currently suspect[s] it was through a recently patched vulnerability." A user asked in the incident thread on GitHub (opens in new tab) how Claude Code ends up putting a GitHub token into a response body.
On October 24, ojensen-berri answered (opens in new tab) that LiteLLM is working with Anthropic on how and why Claude Code embeds those tokens, and that this was not how the attacker obtained them. He also said he did not have a specific vulnerability in mind when he wrote the first post, and that the unexpected gateway user was added with credentials the attacker already had.
Friday's investigation replaces that account. LiteLLM now says the first token came from Agent Platform, not from gateway logs, and that the next two came from CI secrets the owner token was used to exfiltrate on October 10. LiteLLM's timeline does not mention Socket's October 12 workflow. Anthropic has not published a statement of its own.
LiteLLM says it has traced every token it believes the attacker could have reached and is revoking every token on every internal system and vendor platform.
What the payload does
The compromise was reported publicly in that GitHub issue by Lidor Machluf, whom LiteLLM credits with helping detect it. Each malicious wheel dropped three files into the root of site-packages: cook.pth, cook.py and sitecustomize.py. Python runs .pth files and sitecustomize.py automatically at interpreter start, so the stealer fires whenever that environment runs Python, including when someone runs pip.
According to Machluf's analysis and Wiz's, the stealer collects:
- cloud credentials and instance-role tokens for AWS, GCP and Azure;
- SSH, GPG and TLS private keys;
- Kubernetes service account tokens;
- browser passwords and cookies;
- the environment variables of every readable process;
- config files for AI coding tools, including Claude, Codex, Gemini, Cursor and Windsurf.
If DATABASE_URL is set, it also dumps LiteLLM's own credentials table, which holds every upstream provider key the proxy stores. The haul is encrypted and posted to litellm.dev, a lookalike domain registered on October 13 that does not belong to the project.
The second file starts a background process that checks a GitHub file every hour for a domain, then downloads and runs code from it. That file only ever held test values, and GitHub has since taken the repository down. Wiz says the code shows "strong indications of LLM-aided development."
The stolen credentials were used quickly. Wiz says that starting about four and a half hours after exfiltration, between 16:20 and 17:01 UTC, the attacker validated AWS instance-role credentials taken from compromised CI runners and Kubernetes nodes, then called Bedrock's model-listing APIs, a pattern Wiz calls consistent with LLMjacking. In a few environments the attacker also enumerated IAM users, roles and access keys. Microsoft later reported matching collector behavior on Windows and macOS endpoints, including a Windows case where installing an unrelated Python package started the collector, and said second-stage remote code retrieval was not confirmed.
What LiteLLM has not said
- How the attacker found the unrevoked May master key, or whether the public commit was scraped before it was force-pushed.
- What Anthropic itself says about the Claude Code behavior described in the first incident post. LiteLLM now says it is working with Anthropic on that behavior.
- What it is changing in its release process. LiteLLM says it will share process improvements next week.
LiteLLM's original incident post also said its private enterprise registry is distributing an embargoed release that fixes a vulnerability scheduled for public disclosure on October 27. Friday's investigation does not say whether that vulnerability played any role, and the October 24 maintainer comment treated the earlier "recently patched vulnerability" line as a conjecture, not a named CVE.
This is LiteLLM's second supply-chain compromise this year. Datadog notes that the March incident, which affected versions 1.82.7 and 1.82.8, was linked to TeamPCP activity, and that no connection between the two has been established. The October release landed the same day Railway disclosed (opens in new tab) that customer environment variables may have been decrypted. Nobody has tied the two incidents together.
What to do
LiteLLM's guidance applies if any environment installed litellm==1.107.0 or started one of the affected images during the windows above.
- Assume it is compromised. If 1.107.0 ever ran on a host with outbound internet, LiteLLM says to assume the exfiltration succeeded.
- Do not start by running
pip install. That runs the payload again. From a shell, deletecook.pth,cook.py,sitecustomize.pyand their cached.pycfiles from every affectedsite-packages, and kill the detached Python process holding/tmp/remote_code_loader.lock. - Rebuild, then pin. Reinstall
litellm==1.106.3(current PyPIlatest) orlitellm==1.106.2(last pre-incident cut), or better, rebuild images and virtual environments from scratch. - Rotate everything the host could reach. That includes:
- instance and task IAM roles;
- every provider key stored in the LiteLLM proxy database, plus master and virtual keys;
- the
DATABASE_URLpassword; - any secret in the environment of any process on the host.
- Check CloudTrail for
GetCallerIdentitycalls from the instance role around install time, and for that role's credentials being used from outside your infrastructure.
Finding litellm-1.107.0.dist-info, cook.pth or sitecustomize.py on disk confirms exposure. LiteLLM warns that not finding them proves nothing, because containers and temp cleanup remove the evidence.
Pin images by digest rather than deploying latest or main-stable: the floating tags are how a two-hour window reached people who never chose to upgrade. The completed investigation also makes the quieter failure plain. A master key committed to a public repository in May was recognized as needing revocation and was left live. Four months later it was enough to hand an attacker an organization owner's GitHub token, and that was enough to defeat a release process built specifically to resist this attack.

