Packages

LiteLLM 1.107.0 Supply-Chain Attack: Keyless Signing, PyPI Provenance, and AI Gateway Pinning

A technical breakdown of the LiteLLM 1.107.0 supply-chain compromise, why static code signatures failed to stop a lookalike fork build, and how v1.110.2 and 1.108.15 LTS enforce PyPI Trusted Publishing and keyless OIDC verification.

By 0xScorPionSon

9 min read

LiteLLM 1.107.0 Supply-Chain Attack: Keyless Signing, PyPI Provenance, and AI Gateway Pinning

LiteLLM supply chain hardening architecture showing lookalike fork to PyPI wheel 1.107.0, OIDC keyless gate, digest pinning, and AI gateway proxy

Executive Summary

  • What happened: On October 21, 2026, LiteLLM's official release pipeline built, signed, and published litellm==1.107.0 from an attacker-controlled lookalike repository (Berri-AI/litellm), embedding a startup credential stealer (cook.pth and cook.py) and a dormant remote-code loader (sitecustomize.py) into all seven PyPI wheels and container images on GHCR and Docker Hub (Qualys, GitHub Issue #47826).
  • Why it matters again on November 23, 2026: A November 23, 2026 analysis from Qualys highlights the core architectural lesson for platform teams: a valid artifact signature proves who signed a build, not which source repository produced it—especially when AI gateways concentrate upstream LLM provider keys, proxy master keys, and database credentials in one runtime (Qualys).
  • Current verified baseline: As of November 21, 2026, PyPI's latest stable release is litellm 1.110.2 (with 1.108.15 as the active LTS track), and every release from v1.111.0-dev.3 onward—alongside current 1.106.x, 1.108.x, 1.109.x, and 1.110.x patch releases—now ships with PyPI Trusted Publishing attestations and keyless Cosign OIDC verification (PyPI, GitHub Releases).
  • Engineering verdict: Never rely on floating container tags (latest, main-stable) or unverified PyPI version specifiers. Upgrade to 1.110.2 or 1.108.15 (LTS), verify both the OIDC certificate identity and PyPI provenance attestation in CI, pin exact SHA-256 digests, and enforce default-deny network egress on AI gateway containers.

Adoption Telemetry and Release Timeline

LiteLLM serves as both a Python SDK and a centralized AI Gateway proxy supporting more than 100 LLM providers, with over 2,000 dependent packages in the Python ecosystem (PyPI, Legit-Labs Playbook). Because the proxy holds upstream API keys and virtual keys for entire engineering organizations, its release pipeline has become a high-value target twice in 2026.

The October 21, 2026 1.107.0 compromise was distinct from the March 24, 2026 incident affecting 1.82.7 and 1.82.8. In March 2026, attackers uploaded malicious wheels directly to PyPI using compromised maintainer credentials, bypassing GitHub releases altogether with a 34,628-byte litellm_init.pth file (CloudSEK, GitHub Issue #24512). By contrast, the October 21 attack hijacked the official BerriAI/project-releaser automation itself.

Exposure Windows and Post-Incident Hardening Milestones

Date (2026) Milestone or Artifact Scope & Details Provenance / Verification State
Mar 24 litellm==1.82.7, 1.82.8 Direct PyPI upload bypassing GitHub; litellm_init.pth fork-bomb bug exposed stealer No PyPI provenance (CloudSEK)
Oct 10 Initial GitHub CLI Token Theft Attacker used a leaked May Agent Platform key to steal an org owner's GitHub CLI token Internal pipeline compromise (Qualys)
Oct 21 (11:39–13:23 UTC) PyPI litellm==1.107.0 All 7 cp310-abi3 wheels infected (cook.pth, cook.py, sitecustomize.py); yanked at 13:23Z Built from Berri-AI/litellm; no PyPI attestation (GitHub Issue #47826)
Oct 21 (11:46–14:20 UTC) GHCR & Docker Hub v1.107.0 v1.107.0, latest, main-latest, main-stable for litellm, -database, -non_root; yanked by 17:13Z Valid signature, wrong SLSA source repo (Qualys)
Oct 23 Cosign Signing Key Rotation Maintainers rotated the long-lived Cosign release key Keyed verification via rotated fingerprint (Qualys)
Nov 15 v1.111.0-dev.3 Keyless Pivot Transitioned container signing to keyless OIDC + PyPI Trusted Publishing Full PyPI provenance + Cosign OIDC (PyPI)
Nov 19–21 v1.110.2 & 1.108.15 (LTS) Current stable (1.110.2, 331.2 MB across 8 files) and LTS (1.108.15) releases Full PyPI provenance via BerriAI/project-releaser (GitHub Releases)

Note that pre-release 1.107.0rc1, 1.107.0rc2, and 1.107.0.dev* builds were not affected, and LiteLLM's private enterprise registry remained isolated from the public release compromise (GitHub Issue #47826, Legit-Labs Playbook).


Attack Mechanics, .pth Startup Hooks, and Why Signatures Alone Failed

1. From Leaked Key to Lookalike Fork

The October 21 breach began months earlier. According to Qualys's synthesis of the post-mortem, a configuration file containing an administrative key for LiteLLM's internal Agent Platform was committed to a public repository in May 2026 (Qualys). On October 10, an attacker used that key to obtain an organization owner's GitHub CLI token and subsequently harvested additional maintainer tokens via short-lived workflows.

On October 21, the attacker used the stolen owner token to override branch protection and point the BerriAI/project-releaser pipeline (run 39587059944) at a hyphenated lookalike fork: https://github.com/Berri-AI/litellm at commit 20535d8fa11f786a6c24df7488a0e449ed5f09ad (GitHub Issue #47826). That commit chain stacked 10 malicious commits on top of a legitimate main commit (a8113b0d), injecting +data = "cook" into [tool.maturin] in pyproject.toml and COPY cook ./cook into the proxy Dockerfiles.

2. Why Valid Signatures Didn't Catch It

Because the legitimate release automation executed the build, maturin 1.9.4 compiled the wheels normally and Cosign signed the resulting container images with the valid project key (GitHub Issue #47826). Downstream consumers checking only a Cosign public key saw a valid signature.

However, the BuildKit SLSA provenance embedded in the v1.107.0 images explicitly recorded the anomaly: the builder was BerriAI/project-releaser, but the source URI was github.com/Berri-AI/litellm (with a hyphen) rather than github.com/BerriAI/litellm (GitHub Issue #47826, Qualys). Any admission controller or deployment policy that enforced source-repository identity alongside the signature would have rejected v1.107.0 before deployment.

3. Runtime Trigger Model: cook.pth and sitecustomize.py

Unlike npm postinstall scripts, the 1.107.0 PyPI wheels did not execute code during pip install. Instead, litellm-1.107.0.data/purelib/ dropped three files directly into site-packages (GitHub Issue #47826, Legit-Labs Playbook):

  1. cook.pth (12 bytes): Contains import cook, which Python's site module evaluates automatically on every interpreter startup—even if the user never runs import litellm.
  2. cook.py (22,252 bytes): Unpacks a 1,237-line stealer (privcollect) that harvests SSH keys, .env files, AWS/GCP/Azure credentials, Kubernetes service account tokens, AI coding tool configs (Claude, Codex, Gemini, Cursor, Windsurf, Copilot), /proc/*/environ, and cloud IMDSv2 tokens (validating AWS roles via STS GetCallerIdentity). When DATABASE_URL is set on a LiteLLM proxy, mod_db_litellm spawns prisma to dump LiteLLM_CredentialsTable and LiteLLM_ProxyModelTable. Collected data is encrypted with AES-256-CBC + RSA-4096-OAEP and POSTed to http://www.litellm.dev/healthcheck (a lookalike domain registered October 13, 2026).
  3. sitecustomize.py (25,509 bytes): Forks a detached daemon holding /tmp/remote_code_loader.lock that polls a GitHub dead-drop (letters9813/pythonclient-test/main/domain.txt) every 3,600 seconds for second-stage Python execution.

4. Verifying Clean Releases with Keyless Cosign and PyPI Provenance

Starting with v1.111.0-dev.3 on November 15, 2026, and backported across active 1.106.12, 1.108.15 (LTS), 1.109.3, and 1.110.2 releases, LiteLLM now publishes PyPI Trusted Publishing attestations and keyless Cosign OIDC signatures (PyPI, GitHub Releases).

In CI/CD and Kubernetes admission pipelines, verify both the builder workflow identity and OIDC issuer before pulling or promoting an image, and pin Python dependencies by hash:

# 1. Verify container image via keyless Cosign OIDC (v1.110.2 or 1.108.15 LTS)
cosign verify \
  --certificate-identity https://github.com/BerriAI/project-releaser/.github/workflows/release.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/berriai/litellm:v1.110.2

# 2. Verify PyPI wheel attestation and lock hashes with uv / pip-audit
uv lock --upgrade-package litellm==1.110.2
uv export --format requirements-txt --locked -o requirements.lock
pip install --require-hashes -r requirements.lock
pip-audit -r requirements.lock

On PyPI, litellm 1.110.2 (uploaded November 19, 2026 via twine/7.0.0 on CPython/3.13.16) carries verified attestations linking all eight release files—including litellm-1.110.2.tar.gz (sha256:a483c8d3078c1bd27a9fe9c831ac2ce09d41b728a7ea6e9a3ce48db276edeef5) and manylinux_2_28_x86_64.whl (sha256:9d94d1c7d524b6fd10c14f9c8c6c4f0ac31705f9964ac59dcfd8337c046d8917)—to github.com/BerriAI/project-releaser commit ff7354704d3ae5a319e8ca48f0ab17037b042e84 (PyPI).


Ecosystem Comparison and Upgrade Checklist

When choosing which LiteLLM artifact or branch to standardize on as of late November 2026, teams must weigh release stability, cryptographic provenance, and attack-surface minimization.

Release / Artifact Status (Nov 2026) Signing / Provenance Model Key Fixes & Trade-Offs Recommended Use
v1.107.0 Compromised / Yanked Compromised key; SLSA source Berri-AI/litellm Contains cook.pth, cook.py, sitecustomize.py (GitHub Issue #47826) Never run; rebuild & rotate all secrets
v1.106.2 Legacy Clean Patch Pre-rotation Cosign key; no PyPI provenance Safe emergency fallback during Oct 21 incident (GitHub Issue #47826) Migrate off to 1.108.15 or 1.110.2
1.108.15 (LTS) Active LTS (Nov 21) Keyless Cosign OIDC + Full PyPI provenance Stability-focused; enforces api_key/env var on keyless JSON configs (#50819) (GitHub Releases) Production AI Gateways needing stability
v1.110.2 Latest Stable (Nov 19) Keyless Cosign OIDC + Full PyPI provenance Fixes /key/info auth leak (#52838), Anthropic temperature=1 400s, memory growth (GitHub Releases) New deployments & latest features
litellm-core SDK-Only Distribution Built from source checkout (build_core_distribution.py) Drops proxy CLI, dashboard, and extras; smaller footprint (PyPI) Python apps using completion() only

Upgrade and Containment Checklist

  1. Do not run pip or python inside suspect environments: Any Python invocation executes cook.pth and sitecustomize.py again. Inspect filesystems from a clean host or container image (Qualys, GitHub Issue #47826).
  2. Audit exact digests, not mutable tags: Check docker inspect, Kubernetes pod.status.containerStatuses[].imageID, and lockfiles for 1.107.0 (being careful not to confuse 1.107.0rc1/rc2/dev* which were clean) (Legit-Labs Playbook).
  3. Rotate every reachable credential if exposed: Rotate proxy master and virtual keys, DATABASE_URL passwords, every upstream LLM provider key stored in LiteLLM_CredentialsTable, CI/CD tokens, and cloud IAM roles—and check CloudTrail for unexpected STS GetCallerIdentity calls (Qualys).
  4. Rebuild from scratch and enforce egress allowlists: Never rely on pip uninstall litellm. Rebuild virtual environments and containers on 1.110.2 or 1.108.15 (LTS), and apply default-deny network egress so the gateway can reach only approved LLM provider endpoints and Postgres/Redis (GitHub Issue #47826).
  5. Enforce OIDC source-repo policy in CI/CD: Require both --certificate-identity and --certificate-oidc-issuer checks in cosign verify and reject PyPI packages lacking Trusted Publishing attestations (PyPI, CloudSEK).

Frequently Asked Questions

1. Does uninstalling litellm==1.107.0 remove the malware?

No. cook.pth, cook.py, and sitecustomize.py sit in site-packages outside the litellm package directory, and a detached daemon may still hold /tmp/remote_code_loader.lock. Furthermore, any stolen credentials remain valid until rotated. Rebuild the environment from scratch and rotate all reachable secrets (Qualys, GitHub Issue #47826).

2. Were environments affected even if application code never imported litellm?

Yes. Python's site module automatically processes .pth files and sitecustomize.py whenever the Python interpreter starts. Even running pip or an unrelated Python CLI inside an affected virtual environment or container triggers the payload (Qualys).

3. Which LiteLLM version should teams pin as of November 2026?

Pin litellm==1.110.2 (latest stable) or 1.108.15 (LTS) by exact SHA-256 hash or container digest. Both carry full PyPI Trusted Publishing provenance and keyless Cosign OIDC signatures (PyPI, GitHub Releases).

4. Were LiteLLM Enterprise private-registry customers affected?

According to the LiteLLM maintainers and Qualys's analysis, customers pulling from the private enterprise release registry were not affected by the October 21 1.107.0 compromise (Qualys, GitHub Issue #47826).

5. Why did 1.108.15 (LTS) break some keyless JSON-configured providers?

In 1.108.15 (LTS), pull request #50819 requires an explicit api_key or provider environment variable on keyless JSON-configured deployments for other providers, returning HTTP 401 when omitted (GitHub Releases).


Sources

  1. Qualys Blog (November 23, 2026) — LiteLLM 1.107.0 Supply Chain Attack: How to Secure AI Gateways Beyond Code Signatures: https://blog.qualys.com/product-tech/2026/11/23/litellm-1-107-0-supply-chain-attack-ai-gateway-security-primary-keyword-litellm-1-107-0-supply-chain-attack-litellm-1-10
  2. GitHub Issue BerriAI/litellm#47826 (October 21, 2026) — [SECURITY] litellm 1.107.0 compromised (PyPI removed; Docker latest/main-stable removed): https://github.com/BerriAI/litellm/issues/47826
  3. PyPI litellm Project & Provenance Records (November 19–21, 2026) — litellm 1.110.2 Release Files & Trusted Publishing Attestations: https://pypi.org/project/litellm/
  4. GitHub Releases BerriAI/litellm (November 19–21, 2026) — v1.110.2, 1.108.15 (LTS), and Keyless Cosign Verification Commands: https://github.com/BerriAI/litellm/releases
  5. Legit-Labs Supply Chain Playbooks (October 21, 2026) — LiteLLM 1.107.0 Release-Pipeline Compromise Investigation Playbook: https://github.com/Legit-Labs/supply-chain-playbooks/blob/main/litellm_1_107_0/playbook.md
  6. CloudSEK Adversary Intelligence (April 1, 2026) — The Scanner Was the Weapon: 36 Months of Precision Supply Chain Attacks Against DevSecOps Infrastructure: https://www.cloudsek.com/blog/the-scanner-was-the-weapon-36-months-of-precision-supply-chain-attacks-against-devsecops-infrastructure

More on Packages

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla