LiteLLM malicious package GitHub token leak

How a GitHub Token Leak Led to Malicious LiteLLM Package on PyPI and Docker Hub

On October 21, 2026, threat actors published a backdoored version of LiteLLM, a popular Python package for AI gateway management, to both PyPI and Docker Hub. The attackers compromised the release pipeline by stealing GitHub credentials, bypassing multiple security controls to inject a credential stealer and backdoor into version 1.107.0. This incident exposes a critical weakness in open-source software supply chains: even well-intentioned projects can be undermined when authentication secrets are exposed in deployment logs.

LiteLLM Package Compromise: GitHub Token Leak and Supply Chain Attack

What Happened During the LiteLLM Attack

On October 21, 2026, around 4:00 a.m., LiteLLM's automated release pipeline was hijacked to publish version 1.107.0 to PyPI and Docker Hub. The malicious package contained two payloads: a credential stealer designed to harvest sensitive data from the infected environment, and a backdoor for persistent remote access. LiteLLM's security team discovered the compromise within hours and immediately revoked the affected version and alerted users. The incident was publicly disclosed on October 22, 2026, with the team acknowledging that attackers had obtained GitHub credentials, likely from logs or cached authentication tokens in the continuous integration (CI) environment.

The attack succeeded because the threat actors did not rely on a single weak point. Instead, they overcame "multiple independent security controls," suggesting they had thorough knowledge of LiteLLM's release workflow and possibly insider access or extended reconnaissance of the repository infrastructure.

Why GitHub Tokens Are a High-Value Target

GitHub Personal Access Tokens (PATs) and Actions tokens grant permission to push code, modify branches, create releases and publish packages to upstream registries like PyPI and Docker Hub. These tokens are often stored in CI/CD configuration files, environment variables, logs and deployment scripts, many of which are not consistently encrypted or rotated. A single leaked token can give an attacker the ability to impersonate the legitimate developer or service account and push updates across all downstream channels.

In LiteLLM's case, the token was apparently visible or recoverable from gateway logs. This is a common pattern: developers enable verbose logging for debugging, forget to redact secrets before committing logs to version control or artifact storage, or use tokens that never expire. The token then remains available to anyone with access to the CI environment, old build artifacts or cached container layers.

The Supply Chain Cascade: Why This Matters Beyond LiteLLM

LiteLLM is a dependency used in AI and large language model applications, often integrated into other projects and services. A backdoored version automatically propagates to any project that pins the package version or uses a loose version constraint (e.g., "LiteLLM >= 1.100.0"). In the 24-48 hours between release and detection, an unknown number of developers and CI systems likely pulled the malicious version. Each pull created a potential infection vector: credential theft from the local environment, persistence via backdoor shells, or lateral movement to connected systems.

This cascade effect is why open-source package compromises are classified as critical supply chain attacks. The attacker does not need to breach every downstream user. They only need to compromise one upstream package, and the entire ecosystem becomes vulnerable. The LiteLLM incident also demonstrates that even security-conscious teams using PyPI and Docker Hub, both of which have verification and scanning mechanisms, can be circumvented if the attacker controls the publishing credentials.

How Credentials Leaked into Gateway Logs

LiteLLM's engineering team did not initially name the exact log storage or CI system where the token was exposed. However, common culprits in Python projects include:

  • GitHub Actions runner logs stored in unencrypted form on the Actions interface or in artifact caches
  • Debug output from deployment scripts that printed token values to stdout
  • Container image layers that included shell history or environment variable dumps
  • Backup or test logs committed to a public or insufficiently restricted git branch
  • API responses or webhook payloads logged during release testing

The fact that the token was recoverable suggests it was not masked or stripped by the CI system's built-in secret-redaction features, or those features were not enabled. This is a configuration oversight, not a flaw in GitHub itself, but it illustrates why CI/CD pipelines are attractive targets for reconnaissance.

What Developers Should Do Immediately

If you use LiteLLM or any AI gateway that depends on it, take these steps now:

  1. Check your pinned version or version constraint for LiteLLM in your requirements.txt, poetry.lock, or package.json.
  2. If you installed version 1.107.0 at any time between October 21 and October 22, 2026, assume your environment may have been compromised.
  3. Regenerate all API keys, credentials and tokens that were accessible from the system where LiteLLM was installed, including AWS keys, database passwords and internal service tokens.
  4. Scan your CI/CD logs, container registries and artifact caches for evidence of the malicious version being pulled or executed.
  5. Update LiteLLM to the patched version released by the team and redeploy.

For broader protection, audit your own release pipeline to identify where secrets are stored, logged or cached. Implement token rotation, use short-lived credentials in CI environments and enable automated secret redaction in all log aggregation systems.

Lessons for Open-Source Maintainers

The LiteLLM compromise highlights that security is only as strong as the weakest link in the release chain. Even if your code is secure and your package verification is sound, a leaked credential can undo all that work. Maintainers should:

  • Never commit or log authentication tokens; use GitHub's built-in secret-masking features in CI/CD.
  • Rotate PATs and Actions tokens on a fixed schedule, even if they are not suspected of compromise.
  • Use ephemeral credentials or workload identity federation (e.g., OIDC with GitHub Actions) instead of long-lived tokens whenever possible.
  • Restrict PyPI and Docker Hub credentials to only the permissions needed for publishing, not full repository access.
  • Monitor for unexpected package releases by setting up alerts on package metadata changes and using signature verification for published artifacts.

What This Reveals About Open-Source Security Practice

The LiteLLM incident is not an anomaly. It is part of a pattern: Codecov, ua-parser-js, event-stream and dozens of other packages have been compromised through similar supply chain exploits. The common thread is that maintainers and projects often prioritize development velocity over security infrastructure. Logging, for convenience, includes raw values of secrets. CI/CD environments are powerful and widely permissioned. Package registries trust that if a token is valid, the push is legitimate.

The ecosystem is slowly moving toward better practices: PyPI has implemented trusted publisher workflows that use OIDC instead of long-lived tokens, GitHub has added secret scanning in repositories, and tools like Sigstore enable cryptographic verification of software provenance. However, adoption is uneven. Smaller projects and solo maintainers often lack the resources or knowledge to implement these controls. This asymmetry creates a persistent vulnerability surface.

FAQ

**Was my system infected if I installed LiteLLM 1.107.0?

Not necessarily. The malicious version executed payload code when the package was imported or when the AI gateway was initialized, but the damage depended on what credentials were available in the local environment and whether network connectivity to the backdoor command-and-control server was possible. If you installed the package, you should regenerate your secrets as a precaution.

**How can I verify that a package is legitimate before installing it?

Use PyPI's package history feature to check publish dates and maintainer accounts. Install packages signed with PGP or Sigstore where available. Pin to specific versions in your dependencies rather than using loose constraints. Enable audit logging and review package updates before deploying them to production.

**Should I stop using open-source packages because of supply chain attacks?

No. Open-source software is used by billions of people and is often more secure and auditable than proprietary alternatives. The correct response is to be selective about dependencies, keep them updated, monitor security advisories and implement layered security controls so that a single compromised package does not cascade into a full system breach.

**What is the difference between a credential stealer and a backdoor?

A credential stealer runs once (or on a schedule) and extracts secrets from the infected system, exfiltrating them to the attacker. A backdoor provides persistent remote access, allowing the attacker to execute arbitrary commands and maintain control over time. The LiteLLM package contained both, maximizing the attacker's options: immediate data theft and long-term system compromise.

Source: The Hacker News