Back to all lessons
Awareness Lessons
yesterday

Unrevoked API Key Enables LiteLLM Supply-Chain Attack, 49K Malicious Downloads

An API key accidentally exposed in May was never revoked, giving an attacker persistent, privileged access to LiteLLM's GitHub repositories months later. This single oversight allowed the adversary to poison a widely-used open-source package on PyPI, resulting in approximately 49,000 downloads of credential-harvesting malware. The stolen cloud credentials were immediately weaponized to access AWS AI services — a pattern known as LLMjacking — amplifying the damage far beyond the initial compromise. This incident illustrates that a leaked secret left unrevoked is functionally equivalent to handing an attacker a permanent key to your infrastructure.

Tactical Insight

Immediate actions

  • Audit and revoke all exposed or potentially compromised API keys, tokens, and secrets immediately upon discovery.
  • Remove or quarantine the malicious PyPI package version and notify downstream users to downgrade or upgrade to a clean release.
  • Rotate all cloud credentials (AWS, etc.) associated with affected projects and review IAM access logs for unauthorized usage.

Long-term improvements

  • Implement automated secret scanning in CI/CD pipelines (e.g., GitHub Advanced Security, Trufflehog) to detect and block committed secrets before they reach public repositories.
  • Adopt short-lived, scoped credentials and enforce automatic expiration policies so that any leaked secret becomes useless within a defined window.
  • Establish a formal secrets lifecycle management process that mandates immediate revocation upon any suspected exposure, with ownership assigned to a named team.

Detection measures

  • Enable anomaly detection and alerting on cloud accounts (AWS CloudTrail, GuardDuty) to flag unusual API calls such as new AI service provisioning from unfamiliar identities.
  • Monitor package publishing pipelines for unexpected releases or changes to maintainer accounts, and use package signing (Sigstore/PyPI Trusted Publishers) to verify integrity.

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.