adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

[Security] litellm dependency exposes ADK users to supply chain attack (PYSEC-2026-2)

Open me-her opened this issue 8 months ago • 2 comments

Summary

On March 24, 2026, malicious versions of litellm (v1.82.7 and v1.82.8) were published to PyPI via compromised maintainer credentials. ADK lists litellm>=1.75.5 as an optional dependency (in the [extensions] extra) with no upper-bound pin, meaning any user who ran pip install google-adk[extensions] during the ~3-hour window — or who has unconstrained resolution in CI — could have pulled in the compromised package.

What the malicious payload does

The compromised versions contain a .pth file (litellm_init.pth) that executes automatically on every Python process startup — no import required. It:

  1. Harvests credentials: SSH keys, .env files, AWS/GCP/Azure creds, Kubernetes configs, database passwords, shell history, crypto wallets, CI/CD secrets
  2. Exfiltrates via AES-256-CBC + RSA-4096 encrypted POST to an attacker-controlled lookalike domain (models.litellm.cloud)
  3. Installs persistence: a systemd user service at ~/.config/sysmon/sysmon.py and attempts to create privileged pods in kube-system to spread across Kubernetes nodes

Why this matters for ADK specifically

  • ADK's lite_llm.py is a deep, first-class integration (~500+ lines), not a thin wrapper. It's the gateway for all non-Google model providers (OpenAI, Anthropic via LiteLLM, Groq, Ollama, etc.)
  • Gemma3Ollama also inherits from LiteLlm
  • The registry error messages actively recommend users install litellm
  • ADK is used in production AI agent systems that typically have access to sensitive credentials, API keys, and cloud infrastructure — exactly what this payload targets

Recommended actions

  1. Immediate: Pin litellm>=1.75.5,!=1.82.7,!=1.82.8 (or <=1.82.6) in pyproject.toml to prevent resolution to the known-bad versions
  2. Medium-term: Evaluate whether litellm should remain a dependency at all, given the supply chain risk surface it introduces. litellm has 97M+ monthly downloads, making it a high-value target — and this attack succeeded. Projects like mlflow have already pinned
  3. Long-term: Consider replacing the litellm integration with direct provider SDKs (e.g., openai, anthropic) or a lighter abstraction with a smaller dependency footprint

References

me-her avatar Mar 24 '26 21:03 me-her

If this is already taken care of please close this. Just raised this for awarness.

me-her avatar Mar 24 '26 21:03 me-her

Unauthorized code was identified in LiteLLM versions 1.82.7 and 1.82.8 on PyPI on March 24, 2026. If you use ADK Python with the eval or extensions extras, update to the latest version of ADK Python immediately. If you installed or upgraded LiteLLM during this period, rotate all secrets and credentials. For details and required actions, refer to the ADK security advisory and LiteLLM's Security Update: Suspected Supply Chain Incident.

koverholt avatar Mar 26 '26 03:03 koverholt