Blog

LiteLLM compromise began with an unrevoked key

LiteLLM traced its malicious 1.107.0 release to an admin key committed publicly in May and left unrevoked for more than four months. What the attack chain teaches about secret revocation, token scope, release controls and incident response.

ยท 6 min read

On October 21, 2026, a malicious litellm==1.107.0 was published to PyPI, Docker Hub and GHCR. On October 23 LiteLLM published its account of the attack chain, and the starting point was not a clever exploit. It was an administrative key that had been committed to a public repository on May 27, 2026 and was still valid more than four months later.

How a May mistake became an October release

According to LiteLLM, a file named opencode.json containing an administrative key to an internal deployment of the LiteLLM Agent Platform was committed to the public LiteLLM-Labs/lite-harness repository. About three hours later a follow-up commit deleted the file and the keys were noted as requiring revocation, but the original commit stayed in public history until October 22. In LiteLLM's words: "Because of human error, nobody followed through on revoking the administrative key to the LiteLLM Agent Platform, so it was still valid more than four months later." LiteLLM adds that the incident "has provided a strong illustration of the risks associated with failing to rotate a potentially exposed key."

On October 10 the attacker used that key against the Agent Platform API. The platform had been configured with a GitHub token so it could file pull requests, and one API response returned that token. LiteLLM explains that it "was not a Personal Access Token scoped to the appropriate repositories and capabilities, but was the GitHub CLI OAuth token associated with our GitHub organization owner," and notes that GitHub CLI tokens "are not scoped, are post-2fa, and not subject to GitHub's 'super-user' 2fa reauth flows." From that point, LiteLLM says, the attacker had owner capabilities over its GitHub organization.

With the owner's token, the attacker pushed throwaway branches whose workflows posted repository secrets, including GH_TOKEN and RELEASE_PLEASE_TOKEN, to an attacker-controlled endpoint, then deleted the workflow runs. Those two secrets held the GitHub CLI OAuth tokens of two more maintainers. A second round of exfiltration across private repositories followed on October 12.

The incident post says the PyPI wheels were live from 11:39:51 to 13:23 UTC, that the release "contained compiled malware which steals credentials and loads remote-code execution tools," and that the official v1.107.0 source tag on GitHub does not contain the malicious files. The community report that flagged the compromise is GitHub issue #47826.

Lesson 1: finding a secret is not the same as invalidating it

Deleting the file was the visible fix, and it happened within hours. In our view, that changed nothing for anyone who had already copied the key, and the old commit kept the key readable in history for months. The only action that ends the exposure is revoking the credential at the system that issued it, then issuing a new one if it is still needed.

For a leaked key on a security exam, expect the correct answer to be: revoke or rotate the credential first, then check logs for any use of it, then clean up the code and history. Answers that only remove the secret from the repository leave the attacker's copy working. Storing secrets in a managed vault with rotation, instead of in configuration files, is the preventive control. Our AWS Certified Security Specialty (SCS-C03) study guide on secrets and key material covers how AWS handles this.

Lesson 2: one credential often leads to others

LiteLLM's credential table shows the Agent Platform key was used only to read the Agent Platform API. It led to the owner's GitHub token, which led to repository secrets, which held two more maintainers' tokens. Each hop widened what the attacker could do. This is why exam scenarios reward least privilege and narrowly scoped tokens: when a credential leaks, its scope decides how far an attacker can go. LiteLLM's own description points the same way, since a token scoped to the right repositories and capabilities would not have handed over owner control.

Lesson 3: one owner-level override defeated the release controls

LiteLLM's release workflows lived in a private repository and hardcoded BerriAI as the source owner, so the attacker had to change the workflows to build from a fork. Branch protection on main requires a pull request, two passing checks and approval from the workflow's codeowner. At 10:08:29 UTC on October 21, a push of the change made with the second maintainer's token was rejected by branch protection. At 10:08:34 the attacker used the organization owner's token, which can override branch protection, and the same push went through. The attacker then ran the staging workflow with the source set to the lookalike Berri-AI/litellm fork.

The approval step had also been weakened. In typical operation, LiteLLM says, a release must be kicked off by an authorized engineer and approved by a special account locked to a physical device in its office. Earlier that week this had been relaxed to let any two engineers trigger and approve a release, and the second maintainer's token approved the production gate. The pipeline then signed and published v1.107.0 built from the fork commit, and the third maintainer's token deleted the run records. LiteLLM also notes that with an owner's token the attacker could have relaxed or removed the approval restriction alone, and believes separate tokens were used to avoid noisy audit logs.

For supply-chain questions, the takeaway is that a control is only as strong as the most privileged identity that can bypass it, and that a signature proves which pipeline built an artifact, not what source it was built from. In our view, owner accounts with override rights deserve the strongest protection, and checking a published artifact against the tagged source is the kind of provenance check that exposes a build from the wrong repository: here the malicious files were absent from the official source tag.

Lesson 4: incident response assumes the worst until proven otherwise

LiteLLM's containment steps are a useful model answer. The PyPI releases were frozen by 13:23 UTC and the Docker images were removed by 14:20 UTC. LiteLLM locked its public registries, removed all members from its GitHub organization except a single account temporarily promoted to owner, and began operating on the assumption that "every possible token, key, or authenticator belonging to our organization was exfiltrated." It says it is revoking every token associated with every internal system and vendor platform.

The guidance for users follows the same logic. If an environment started Python with 1.107.0, treat it as compromised. Do not start with pip install, because any Python start runs the malicious cook.pth and sitecustomize.py again. Delete those files, kill the detached Python daemon, and reinstall pinned to litellm==1.106.2, although rebuilding images and virtual environments from scratch is better. Then rotate everything the host could reach, including the instance or task IAM role, provider keys, the master and virtual keys, the database password and any secret in the environment of any process on the host. For AWS users, LiteLLM suggests checking CloudTrail for GetCallerIdentity calls from the instance role around install time, then for use of the role's credentials from outside your infrastructure. That pairing of contain, rotate and then hunt in logs is the pattern behind many incident-response questions; see the SCS-C03 guide section on responding to events.

The short version for exam day: a leaked secret stays dangerous until it is revoked, and every secret a compromised host could reach should be treated as exposed and rotated.

Read the SCS-C03 study guide

Sources