Back to all lessons
Awareness Lessons
14 hours ago

LiteLLM Master Key Exposure Enables Supply Chain Attack via PyPI

A developer accidentally committed a master key to a public GitHub repository, granting an attacker owner-level access to LiteLLM's entire GitHub organization. With that access, the attacker injected an infostealer and remote access trojan into version 1.107.0 of the LiteLLM PyPI package, potentially compromising credentials and API keys of every downstream user who installed it. This incident illustrates how a single secret exposure can cascade into a full supply chain compromise affecting thousands of consumers. Secrets in source code are a well-documented, preventable risk that automated scanning tools can catch before they ever reach a public repository.

Tactical Insight

Immediate actions

  • Rotate or revoke all exposed secrets immediately and audit all repository access logs for unauthorized activity since the key was first committed.
  • Remove the compromised package version from PyPI and notify downstream users to upgrade and rotate any credentials loaded during the affected period.

Long-term improvements

  • Enforce pre-commit hooks and CI/CD pipeline secret-scanning (e.g., GitHub Advanced Security, Gitleaks, or Trufflehog) to block secrets from ever being pushed to any repository.
  • Apply least-privilege principles to repository tokens and API keys so that no single credential grants owner-level access to the entire GitHub organization.
  • Implement mandatory code-signing and provenance attestation (e.g., SLSA framework) for all packages published to PyPI or other registries.

Detection measures

  • Configure real-time alerting on any new repository collaborator additions or permission escalations within the GitHub organization.
  • Monitor PyPI release pipelines for unexpected file changes or new binaries introduced between release commits and the published artifact.

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.