LiteLLM 1.107.0 was compromised: how to check your machines and what to rotate

LiteLLM 1.107.0 was compromised: how to check your machines and what to rotate

This article was written with AI assistance and edited by a person.

Close-up of a metal chain link in warm light
Photo by Alban Mehmeti on Pexels

On Oct 21, 2026, a malicious LiteLLM 1.107.0 shipped to PyPI, Docker Hub and GHCR for a few hours. Here's how to check whether you pulled it, how to clean up, and which secrets to rotate.

LiteLLM is the library a lot of us use to call many model APIs through a single interface, or to run a proxy in front of them. On Oct 21, 2026, a malicious version, 1.107.0, went out through its normal channels for a few hours. If you installed or pulled LiteLLM that morning, read this before you do anything else.

Everything below comes from LiteLLM's incident post, last updated Oct 21 at 4:30 PM ET. Times are converted to Eastern.

What shipped, and when

Channel What was bad Live (ET, Oct 21)
PyPI litellm==1.107.0, all seven wheels 7:39 to 9:23 AM
Docker Hub Tags v1.107.0, latest, main-latest, main-stable 7:46 to 10:20 AM
GHCR The same tags until 9:51 AM

The bad Docker Hub image digest starts with sha256:1bbcb1443bc9. On GHCR, the litellm-database image starts with c00f9d92c427 and litellm-non_root with 7b00e91cd2fe. The full digests are in the incident post.

LiteLLM says the package contained compiled malware that steals credentials and loads remote-code-execution tools. The Enterprise private registry wasn't affected.

How it happened

According to LiteLLM:

  • The attacker had three developers' GitHub CLI tokens, one of them from an org owner. They used them to turn off branch protection and force-push.
  • The packages were built from a lookalike repo, Berri-AI/litellm. The real source tag on GitHub is clean.
  • Release permissions had been expanded temporarily on the Monday before.
  • The tokens were probably taken from the logs of an internal LiteLLM deployment that was exposed to the internet. In some cases, Claude Code had embedded GitHub CLI OAuth tokens in response bodies, and those bodies were logged.

How the attacker got into that deployment is still being investigated. LiteLLM says it suspects a recently patched vulnerability and hasn't confirmed it. It also mentions an embargoed fix with a disclosure date of Oct 27.

The lesson for the rest of us is the token-in-logs part. If you log full LLM responses, those logs can hold secrets your agent printed.

Check your machines

On each machine, container image and CI runner that might have installed LiteLLM on Oct 21:

  1. Run pip show litellm and look at the version.
  2. In site-packages, look for a litellm-1.107.0.dist-info folder, a cook.pth file and an unexpected sitecustomize.py.
  3. Check your image digests against the ones above.

A clean result doesn't prove you're clean. LiteLLM says this plainly. If 1.107.0 ran anywhere with outbound internet, treat it as compromised.

We put these checks into a script that's tested against a fake infected environment. It's in the Python and npm supply-chain lockdown kit.

Clean up (in this order)

LiteLLM's steps, in order:

  1. Don't run pip first. The malware loads on Python startup, and pip is a Python program.
  2. Delete cook.pth, cook.py, sitecustomize.py and their __pycache__ files.
  3. Stop the background process holding /tmp/remote_code_loader.lock.
  4. Reinstall litellm==1.106.2. It's better to rebuild the environment or image from scratch.
  5. Assume your secrets leaked if the host had outbound internet.

What to rotate

LiteLLM's list:

  • the cloud IAM role or keys the host could use
  • every provider API key stored in the proxy database
  • the LiteLLM master key and all virtual keys
  • the password in DATABASE_URL
  • any other secrets in the environment

On AWS, LiteLLM suggests checking CloudTrail for unexpected GetCallerIdentity calls, which is a quick way to see whose keys you're holding, so it often shows up when stolen keys get tested.

Stop the next one

LiteLLM says this isn't its first incident: there was an earlier one in March. The habits below won't stop a compromised maintainer, but they shrink the window:

The lockdown kit also includes a Claude Code hook that blocks unpinned pip install and npm install commands before your agent runs them.

FAQ

Which LiteLLM version is safe?

LiteLLM says to pin 1.106.2. Only 1.107.0 was malicious, but pinning the exact version stops a loose requirement from pulling a bad release again.

I don't see cook.pth. Am I safe?

Not necessarily. LiteLLM says a clean check does not prove the environment is clean. If 1.107.0 or one of the bad Docker images ran with internet access, rotate your secrets anyway.

Was the LiteLLM source code on GitHub hacked?

LiteLLM says the official GitHub tag is clean. The bad packages were built from a lookalike repository, Berri-AI/litellm, after an attacker used stolen GitHub CLI tokens to get into the release process.

Were LiteLLM Enterprise users affected?

LiteLLM says the Enterprise private registry was not affected.

Is the LiteLLM investigation finished?

No. As of Oct 22, 2026, LiteLLM is still updating its incident post. Check it for changes before you close out your own cleanup.

Sources

  1. LiteLLM, “Contained: Oct 21, 2026 LiteLLM release v1.107.0 Compromised” (last updated Oct 21, 2026, 20:30 UTC)https://docs.litellm.ai/blog/security-incident-oct-21-2026
  2. pip documentation: Secure installs (hash-checking mode)https://pip.pypa.io/en/stable/topics/secure-installs/

Report a correction

Before you go
Matching resources

Matching resources

Keep reading

Keep reading

Newsletter

The Codema publication. Consent is required. You are not subscribed until you confirm from the email, and nothing is stored if email delivery is not connected.