Writing · · 8 min read
Deleted is not revoked: the LiteLLM master key
A key pushed to a public repository was deleted but never revoked. 136 days later it opened an AI agent, the agent handed over an owner’s GitHub token, and a malicious LiteLLM release went out through the real pipeline.
By Liju Abdul Karim, Founder & MD, BRev Digital, Dubai

On 27 May 2026 a configuration file was pushed to a public GitHub repository run by LiteLLM, the open-source gateway that many teams put between their apps and their AI models. The file held the master key for an internal LiteLLM service called the Agent Platform. The team noticed and removed the file. The key itself was never revoked.
136 days later, on 10 October, someone used it. On 21 October a malicious LiteLLM release, version 1.107.0, went out through LiteLLM’s own release pipeline to PyPI and Docker Hub. It was live for about two hours, on a package Socket counts at roughly 23 million downloads a week.
LiteLLM has published an unusually candid, minute-by-minute account of how it happened. It deserves credit for that, and it is worth reading slowly, because almost every step in it is something an ordinary engineering team does on an ordinary week.
What happened
- 27 May. An
opencode.jsonfile with the Agent Platform master key was committed to the publicLiteLLM-Labs/lite-harnessrepository. The commit was later force-pushed over. In LiteLLM’s words: “key revocation did not occur for the master key.” - 10 October. Using that key, the attacker called the Agent Platform API. One response, the configuration of a managed agent, contained the GitHub CLI token of one of the two owners of LiteLLM’s GitHub organisation. LiteLLM: the token “was not associated with a service account and was not scoped down.” From there, “the threat actor had owner-level access to all repositories in our GitHub.”
- Within the hour. Short-lived branches ran CI workflows that posted repository secrets to an outside endpoint, among them the GitHub tokens of two more maintainers. The workflow runs were then deleted.
- 12 October. The same trick on private repositories collected their secrets too.
- 21 October. The attacker changed the release workflow to build from
Berri-AI/litellm, a lookalike fork one hyphen away from the realBerriAI/litellm. Branch protection rejected the push, so the owner’s token switched branch protection off. A second maintainer’s token approved the production gate. That approval was possible because a rule requiring a physical-device approver “had been relaxed earlier that week.” A third token deleted the run logs afterwards. - The release. Seven
litellm==1.107.0wheels reached PyPI between 11:39 and 11:40 UTC (15:39 in Dubai), and Docker images followed at 11:46. A GitHub issue flagging the compromise was opened 26 minutes after the PyPI upload; LiteLLM began its response about an hour after that. PyPI quarantined the version by 13:23 UTC, and the Docker tagsv1.107.0,latest,main-latestandmain-stablewere removed or repointed to clean images by 14:20.
What the release did
According to Datadog Security Labs, the package dropped three files into Python’s site-packages: cook.pth, cook.py and sitecustomize.py. Python runs files like these every time it starts. So the code ran in any Python process in that environment, even one that never imported LiteLLM, and deleting the LiteLLM package did not remove it.
It collected cloud credentials (AWS, Google Cloud, Azure, Kubernetes), SSH and Git keys, .env files, npm and PyPI tokens, browser passwords, the sign-in files of AI coding tools, and, where a LiteLLM proxy had a database, the upstream model-provider keys stored in it. It encrypted them and sent them to a lookalike domain, litellm[.]dev. A second part checked a file on GitHub every hour for a server to download more code from. Wiz saw the attacker testing stolen AWS keys about four and a half hours after they were taken, checking access to Amazon Bedrock’s AI models.
This was LiteLLM’s second supply-chain compromise this year. In March, versions 1.82.7 and 1.82.8 were briefly malicious too. Datadog says no link between the two has been established.
Deleting a file does not revoke a key
This is the lesson I would put on a wall. The moment a secret is pushed to a public repository, you have to assume someone copied it. Bots scan GitHub for keys around the clock. Deleting the file, rewriting history or making the repository private changes what the next visitor sees. It does nothing about what the last visitor took.
So a leaked key has exactly one fix: revoke it and issue a new one, the same day. Here a team clearly did the right thing with the other exposed keys and missed one. That is the most human failure in the whole chain, and it went unnoticed for 136 days.
The agent was holding a person’s keys
The second link is the one I think about most, because I build AI agents for a living. The Agent Platform was an experimental tool that opened pull requests on GitHub. To do that it needed a GitHub token, and the one it had belonged to a person, an organisation owner, with nothing scoped down. The platform then returned that token in an API response to anyone holding its master key.
That is how agents get built under deadline: someone runs the login on their own laptop and the agent inherits everything that person can do. An agent that only needs to open pull requests on one repository was carrying the power to rewrite every repository and every release the company ships. One key opened the agent. The agent opened the owner. The owner opened everything else.
Every safety control had an owner’s override
Branch protection was on, and it did reject the malicious push. The owner’s token then switched it off. The production gate needed an approval, and it got one from a stolen token, because the stronger rule had been relaxed that week. The logs existed, until a token deleted them.
None of these controls failed. Each one could be lifted by an account the attacker already held. A control that an owner token can switch off protects you from mistakes. It does not protect you from someone holding the owner token.
If you run LiteLLM
- If you installed
litellm==1.107.0, or pulled thelatest,main-latestormain-stableDocker tags on 21 October between 11:39 and 14:20 UTC, LiteLLM says to treat that machine as compromised. - Look in
site-packagesforcook.pth,cook.pyandsitecustomize.py, and remove them by hand. Search network logs forlitellm[.]dev. - Rotate every credential that machine could reach, from a clean machine. Upgrading alone is not enough.
- Pin a known-good version. Datadog and Wiz name 1.106.2 as the last safe release before the incident.
Checks for any team, this week
- Turn on secret scanning with push protection for every repository, public and private, so a key is stopped before it is pushed.
- Write down the leak drill: revoke, reissue, then check the logs for use. Deleting the commit is not a step on the list.
- Give agents their own accounts. A service account or a GitHub App, with access to the one repository and the one action the agent needs. Never a person’s login.
- Never let an API send a credential back. Agent and tool configurations should store secrets in a vault and return references, not values.
- Make release approval need a human and a device, and treat any relaxation of that rule as a change that needs its own approval and an end date.
- Don’t install a release on the day it ships. Pin versions, and let new versions of your dependencies age for a few days before they reach a build machine. Both LiteLLM compromises this year were caught within hours.
The attacker did not need a zero-day. They needed one key nobody revoked, one agent holding one person’s token, and one week when one rule was relaxed. Most teams have all three somewhere. The work is finding yours first.
Sources
- LiteLLM: The attack chain behind the v1.107.0 LiteLLM release (post-mortem with the full UTC timeline)
- Datadog Security Labs: LiteLLM supply chain compromise: what you need to know (payload, indicators, 1.106.2)
- Help Net Security: LiteLLM hit by second supply chain attack this year (22 Oct 2026; Socket download figure, Wiz findings)
- Wiz: LiteLLM compromised, steals credentials
- The Hacker News: Leaked LiteLLM master key let attackers steal GitHub tokens and hijack release pipeline