One of 4 breaches in the Trivy supply-chain chain

LiteLLM: tampered PyPI wheels used a .pth startup hook to harvest AI keys and Kubernetes secrets

On March 24, 2026 starting at 10:39 UTC, an attacker bypassed LiteLLM’s official CI pipeline and uploaded tampered versions 1.82.7 and 1.82.8 directly to PyPI for roughly 40 minutes before PyPI quarantined them. Version 1.82.8 embedded litellm_init.pth, executing automatically every time Python started to sweep environment variables, SSH keys, AWS/GCP/Azure credentials, and Kubernetes tokens to models.litellm.cloud. LiteLLM traced the root cause to the compromised Trivy dependency in its CI scanning workflow; LiteLLM Cloud, the official Docker image, and GitHub main stayed clean.

How they got in

LiteLLM sits in the middle of thousands of AI gateways, agent frameworks, and MCP servers, which means its runtime environment almost always holds OpenAI, Anthropic, Bedrock, and cloud credentials.

On March 24, 2026 at 10:39 UTC, an attacker bypassed LiteLLM's official CI/CD release workflow and uploaded two tampered releases (1.82.7 and 1.82.8) directly to PyPI. LiteLLM's founders assessed that the stolen publishing credentials traced back to the compromised Trivy dependency running inside LiteLLM's CI/CD security scanning workflow five days earlier (an attribution kept transparently marked inferred while investigation continued, reinforced on March 26 when checkmarx[.]zone appeared in the IOCs).

Upstream Trivy CI waveDirect PyPI uploadPython & AI environmentsStayed safeTrivy CI secret leakRead the Aqua Security Trivy storylitellm 1.82.7 & 1.82.8Direct PyPI push (40m)litellm_init.pth hookRuns on Python startupCloud, K8s & LLM keysmodels.litellm.cloudDocker, Cloud & GitHubPinned builds untouched123
1Mar 19–24, 2026

Starting at 10:39 UTC on March 24, an attacker using credentials believed exposed in the March 19 Trivy CI wave uploads litellm 1.82.7 and 1.82.8 directly to PyPI.

ConfirmedWhere to stop it: pypi trusted publishers
  1. Mar 19–24, 2026

    Starting at 10:39 UTC on March 24, an attacker using credentials believed exposed in the March 19 Trivy CI wave uploads litellm 1.82.7 and 1.82.8 directly to PyPI.

    Trivy CI secret leaktolitellm 1.82.7 & 1.82.8
  2. Mar 24, 10:39–11:20 UTC

    For roughly 40 minutes before PyPI quarantine, unpinned installs and transitive AI agent builds pull litellm==1.82.8, whose .pth hook executes automatically on interpreter start.

    litellm 1.82.7 & 1.82.8tolitellm_init.pth hook
  3. Mar 24–30, 2026

    Harvested cloud, Kubernetes, SSH, and LLM secrets are POSTed to models.litellm.cloud; LiteLLM pauses releases, verifies GitHub main is clean, and ships v1.83.0 on March 30.

    litellm_init.pth hooktoCloud, K8s & LLM keys

Figure 1. How the attack unfolded, and what stayed isolated. Select any step or box for details.

What they took

The bad wheels stayed live on PyPI for roughly 40 minutes before PyPI quarantined them, yet 40 minutes is an eternity for automated Docker builds and unpinned transitive installs inside AI agent frameworks.

Version 1.82.7 injected a credential stealer into proxy_server.py. Version 1.82.8 went further by dropping litellm_init.pth directly into site-packages. Python automatically executes import lines inside .pth files every single time the interpreter starts, so any container or workstation that ran pip install litellm triggered the stealer on the very next python invocation without ever importing LiteLLM. Harvested environment variables, SSH keys, AWS/GCP/Azure credentials, Kubernetes tokens, and database passwords were encrypted and POSTed to a lookalike domain (models.litellm.cloud) not controlled by BerriAI.

How one breach rippled into 3 more companies

See the whole chain
Where it spread fromKnock-on breaches
Origin
Aqua Security TrivyFeb–Mar 2026

76/77 Action tags, v0.69.4, and 3 linked breaches

with trivy CI credentials
CheckmarxMar 19–May 9, 2026

Actions, OpenVSX, KICS Docker, Jenkins, and repo leak

with harvested AWS API key
European CommissionMar 19–25, 2026

91.7 GB from 71 europa.eu clients

with trivy CI scanning job
LiteLLMMar 24, 2026

Tampered PyPI wheels 1.82.7 & 1.82.8 (~40 min live)

You’re reading this
Origin
Aqua Security TrivyFeb–Mar 2026

76/77 Action tags, v0.69.4, and 3 linked breaches

with trivy CI credentials
CheckmarxMar 19–May 9, 2026

Actions, OpenVSX, KICS Docker, Jenkins, and repo leak

with harvested AWS API key
European CommissionMar 19–25, 2026

91.7 GB from 71 europa.eu clients

with trivy CI scanning job
LiteLLMMar 24, 2026

Tampered PyPI wheels 1.82.7 & 1.82.8 (~40 min live)

You’re reading this

What stayed safe

Strict dependency pinning saved LiteLLM's own official container image (ghcr.io/berriai/litellm), which pinned exact package versions in requirements.txt and never pulled the rogue PyPI uploads. LiteLLM Cloud, installs pinned to v1.82.6 or earlier, and the GitHub main repository also remained untouched. On March 30, LiteLLM resumed releases with clean v1.83.0 built on an isolated "CI/CD v2" pipeline.

How to defend against this

PyPI Trusted Publishers

Disable static maintainer PyPI API tokens and require PyPI Trusted Publishers (OIDC) tied strictly to isolated release workflows separate from third-party scanners.

Pin hashes & scan .pth

Pin Python dependencies with pip --require-hashes (or uv/Poetry lockfiles) and fail CI builds whenever a newly installed wheel adds an unexpected site-packages/*.pth file.

Egress-allowlist AI builds

Restrict outbound DNS and HTTPS egress from build containers and AI gateway pods so rogue lookalike domains like models.litellm.cloud cannot receive exfiltrated secrets.

audit-python-pth-files.sh

Inspect Python site-packages for litellm_init.pth or compromised litellm versions 1.82.7/1.82.8.

#!/usr/bin/env bashset -euo pipefailpython3 -c "import importlib.metadata as m; print('litellm:', m.version('litellm'))" 2>/dev/null || echo "litellm not installed"python3 -c "import site, pathlib; [print(p) for d in site.getsitepackages() for p in pathlib.Path(d).glob('*.pth')]"

Appendix

Evidence log: what’s confirmed and what’s withheld4 claims
ClaimStatusSource
LiteLLM assessed that the compromise originated from the compromised Trivy dependency in its CI/CD security scanning workflow, exposing credentials used to upload directly to PyPIInferredLiteLLM Security Update, Mar 24–30, 2026
litellm==1.82.7 (malicious proxy_server.py) and litellm==1.82.8 (litellm_init.pth + proxy_server.py) were live on PyPI starting March 24 at 10:39 UTC for roughly 40 minutesConfirmedLiteLLM Security Update, Mar 24, 2026
The stealer harvested env vars, SSH keys, AWS/GCP/Azure credentials, Kubernetes tokens, and database passwords and POSTed them to rogue domain models.litellm.cloud (checkmarx[.]zone also added to IOCs on March 26)ConfirmedLiteLLM Security Update, Mar 24–26, 2026
The official LiteLLM Proxy Docker image (ghcr.io/berriai/litellm), LiteLLM Cloud, installs pinned to v1.82.6 or earlier, and LiteLLM’s GitHub main branch were unaffectedConfirmedLiteLLM Security Update, Mar 24–30, 2026
Indicators of compromise3 indicators
  • models.litellm[.]cloud

  • checkmarx[.]zone

  • litellm_init.pth

Reproduction labShell verification script, MIT license

List every .pth startup hook installed across your Python virtual environments and verify no image or lockfile references litellm 1.82.7 or 1.82.8.

Safety note: Read-only Python site-packages inspection.

bash audit-python-pth-files.sh
LiteLLM: tampered PyPI wheels used a .pth startup hook to harvest AI keys and Kubernetes secrets | breachidents