LiteLLM supply chain attack

How a GitHub Token Leak Led to the LiteLLM Supply Chain Compromise

On October 21, 2026, attackers pushed a backdoored version of the LiteLLM Python package to PyPI and Docker Hub by compromising the project's release pipeline. The breach investigation revealed that a leaked GitHub token was the entry point, allowing threat actors to bypass multiple independent security controls and inject a credential stealer and backdoor into a widely-used AI gateway library.

LiteLLM Supply Chain Attack: GitHub Token Leak Behind Backdoor Package

What Happened: The LiteLLM October 2026 Incident

On October 21, 2026, at approximately 4:00 a.m., LiteLLM's release pipeline was compromised to publish version 1.107.0 to both the Python Package Index (PyPI) and Docker Hub. The malicious release contained two payloads: a credential stealer designed to harvest authentication tokens and API keys from affected systems, and a backdoor that would allow persistent remote access. The attack succeeded despite LiteLLM's implementation of multiple independent security controls, indicating a sophisticated breach that targeted the authentication layer itself rather than exploiting application logic.

LiteLLM is an open-source Python gateway used by developers to abstract and manage multiple large language model (LLM) providers—including OpenAI, Anthropic, and others—through a unified API. The library is widely integrated into production systems, meaning the compromised package potentially affected thousands of deployments before the malicious version was detected and removed.

The GitHub Token Leak as the Root Cause

LiteLLM's post-incident investigation concluded that the breach originated with a leaked GitHub personal access token (PAT) or repository secret. GitHub tokens grant programmatic access to repositories and can be configured with permissions to publish to external registries like PyPI and Docker Hub. Attackers who obtain a valid token with sufficient scope can impersonate the legitimate maintainer, commit code, tag releases, and trigger automated CI/CD workflows without requiring the owner's password or additional multi-factor authentication factors that might protect the primary GitHub account.

The token was likely exposed through one of several common vectors: committed accidentally into a Git history (a practice that leaves secrets visible even after deletion), exfiltrated from a developer's local machine through malware or account compromise, harvested from CI/CD logs or environment variables that were incorrectly configured to be publicly readable, or leaked via a third-party service integration that stored the token insecurely. Once in the attacker's possession, the token provided legitimate-looking proof of authorization to the release infrastructure, making the malicious commits and builds indistinguishable from genuine maintenance activity.

How Multiple Security Controls Were Bypassed

LiteLLM's disclosure that attackers compromised "multiple independent security controls" suggests the project had implemented defense-in-depth measures, yet all failed. This typically includes a combination of the following.

  • Commit signing: Repositories may require commits to be cryptographically signed by a known maintainer key, but this check can be bypassed if the attacker has the token and the CI/CD system is configured to skip verification for automated commits.
  • Branch protection rules: GitHub branch protection can mandate code reviews before merging to main or release branches, yet this rule often includes exceptions for automated or administrative workflows.
  • Package registry permissions: PyPI and Docker Hub may have upload restrictions tied to API tokens, but a valid token with the correct scope bypasses these restrictions.
  • Integrity and checksum verification: While downstream users might verify package hashes, the attacker's malicious version becomes the "trusted" official release once it reaches the registry.
  • Rate limiting and anomaly detection: Release infrastructure may flag unusual deployment patterns, but a single malicious release during off-peak hours may not trigger alerts.

The combination of a leaked token and weak enforcement of signing or review gates allowed attackers to satisfy all these controls simultaneously.

Immediate Impact and Detection Timeline

The malicious package remained available on PyPI and Docker Hub until it was detected and removed. The credential stealer payload would have activated upon installation or import, potentially exfiltrating GitHub tokens, API keys for LLM providers, cloud authentication credentials stored in environment variables, and any other secrets accessible from the host system. The backdoor component would allow attackers to maintain persistence and execute arbitrary commands in the context of running LiteLLM processes.

Any developer or system that pulled version 1.107.0 during the window of compromise was at risk. Container environments pulling the image from Docker Hub would be infected upon startup. Python environments using `pip install litellm==1.107.0` or a version constraint that resolved to 1.107.0 would automatically execute the malicious code during installation or at runtime. LiteLLM maintainers and the security community mobilized to publish advisories and release a patched version, but the true scope of affected installations may never be fully known.

Why This Attack Matters for Software Supply Chain Security

This incident exemplifies a critical asymmetry in modern software development: open-source maintainers often operate with minimal security infrastructure, yet their packages are pulled millions of times daily by enterprises and critical systems. A single compromised token or leaked credential can cascade through thousands of dependent projects. The attack also demonstrates that attackers increasingly target authentication infrastructure rather than exploiting bugs in application code.

Organizations that depend on PyPI packages or Docker images now face the uncomfortable reality that the signature of a release—its presence in an official registry, its version number, its commit hash—is only as trustworthy as the security of the credentials used to publish it. This has driven renewed interest in package verification tools, software bill of materials (SBOM) generation, and runtime security monitoring that can detect suspicious behavior from imported libraries.

What Developers and Organizations Should Do Now

If you use LiteLLM in a production environment, take the following steps to assess and remediate your exposure.

  1. Check all container images and Python environments currently running LiteLLM and verify they are not running version 1.107.0.
  2. Review your Git logs, environment variables, CI/CD configurations and secrets management systems to identify whether any credentials were exposed during the compromise window.
  3. Rotate all API keys, GitHub tokens, and cloud credentials that may have been present on systems running the malicious package.
  4. Update to the latest patched version of LiteLLM published after the incident was disclosed.
  5. Implement package verification practices: use hash pinning, vendor dependencies into your repository, and run security scanners on imported packages before deploying them to production.
  6. Monitor third-party dependency updates and follow maintainer security advisories through mailing lists or RSS feeds.

Lessons for the Broader Ecosystem

The LiteLLM compromise reinforces several hard truths about open-source security. Leaked GitHub tokens are not rare; they appear in public repositories, exposed CI/CD logs, and compromised developer machines at a rate that automated scanning services cannot keep up with. Many open-source projects do not have the resources to implement hardware security keys, code signing enforcement, or real-time threat detection.

The attack also highlights why dependency management and supply chain security are now critical competencies for any organization running software. Downloading a package is not a passive act; it is an implicit trust decision in the entire chain of custody from the original developer through every automation tool and registry along the way. When that chain breaks—through a leaked token, a compromised maintainer account, or a misconfigured CI/CD pipeline—the damage can propagate instantaneously to every dependent project.

For maintainers, the takeaway is urgent: audit your release pipeline for secrets, require signed commits and code reviews even for automated releases, use hardware security keys or certificate-based authentication instead of personal access tokens where possible, and consider adopting a minimal-privilege CI/CD architecture where publishing permissions are granted only to specific, time-limited tokens generated during the build process rather than long-lived credentials stored in configuration files.

Source: The Hacker News