Popular Python library LiteLLM hit by supply chain attack that steals cloud credentials

3 Sources

Share

LiteLLM, a widely-used open-source Python interface for accessing multiple large language models, was compromised in a sophisticated supply chain attack. Two malicious versions deployed credential-stealing malware that harvests SSH keys, cloud tokens, and crypto wallets. The breach originated from a Trivy vulnerability scanner compromise and affects hundreds of thousands of potential installations.

News article

LiteLLM Compromised in Sophisticated Supply Chain Attack

LiteLLM, a popular Python library compromised in a devastating supply chain attack, has sent shockwaves through the AI development community. The open-source Python interface, which enables developers to access multiple large language models through a single unified API, saw two malicious versions—v1.82.7 and v1.82.8—removed from the Python Package Index (PyPI) after attackers injected credential-stealing malware into the packages

1

. With over 40,000 stars on GitHub and serving as a critical dependency in numerous AI tooling projects, the compromise potentially affects hundreds of thousands of installations, with some sources estimating as many as 500,000 downloads

3

.

How the CI/CD Pipeline Compromise Unfolded

The attack's sophistication becomes apparent when examining its origins. Krrish Dholakia, CEO of Berri AI, which maintains LiteLLM, confirmed the breach originated from the project's use of Trivy, an open-source vulnerability scanner maintained by Aqua Security

1

. The malware campaign began in late February when attackers exploited a misconfiguration in Trivy's GitHub Actions environment to steal a privileged access token that enabled manipulation of CI/CD pipelines. TeamPCP, the threat actor group behind the attack, used compromised credentials to publish malicious Trivy releases starting March 19, with versions v0.69.4, v0.69.5, and v0.69.6 deployed as weaponized packages. Aqua Security revealed the attackers modified existing version tags associated with the trivy-action GitHub Action script, injecting malicious code into workflows already running in production environments

1

.

TeamPCP Cloud Stealer Targets SSH Keys and Cloud Tokens

The malicious LiteLLM versions deployed a custom-built infostealer called TeamPCP Cloud Stealer, which operates through a three-stage attack mechanism

3

. Version 1.82.8 contained a particularly insidious component: a .pth file called "litellm_init.pth" that executes automatically on every Python process startup, meaning users don't even need to import the library for the credential-stealing malware to activate

2

. The payload harvests an extensive range of sensitive data including SSH keys, environment variables, AWS credentials, GCP service account tokens, Azure secrets, Kubernetes configs, database passwords, shell history, and crypto wallets. It also queries cloud metadata endpoints, extracting instance credentials from EC2 instances and GKE pods

2

.

Detection and Attribution Challenges

The compromise was discovered almost by accident when FutureSearch noticed an MCP plugin running inside Cursor pulled the package as a transitive dependency, causing the machine to run out of RAM due to an exponential fork bomb

2

. A commit pushed to one of the LiteLLM maintainer's forked repositories reading "teampcp owns BerriAI" served as a blunt calling card. TeamPCP has been linked to recent compromises of Aqua Security's Trivy vulnerability scanner on March 19 and Checkmarx's KICS GitHub Action on March 23, following a consistent playbook of compromising maintainer accounts, pushing malicious versions to package registries, and deploying multi-stage credential stealers

2

. The GitHub vulnerability report itself became a target, with a spam attack at 05:44 AM PDT flooding the repository with dozens of AI-generated variations of "Thanks, that helped!" using 19 accounts previously employed in the Trivy spam campaign

1

.

Immediate Actions Required to Rotate Credentials

Dholakia confirmed that LiteLLM's PYPI_PUBLISH token, stored as an environment variable in the project's GitHub repository, was sent to Trivy where attackers obtained it and used it to push new malicious code

1

. The team has deleted all PyPI publishing tokens and is reviewing security measures including trusted publishing via JWT tokens. The Python Packaging Authority issued a security advisory warning that anyone who installed and ran the compromised versions should assume any credentials available to the LiteLLM environment may have been exposed and must rotate them immediately

1

. Security researchers at Endor Labs emphasize the payload's capability for lateral movement across Kubernetes clusters by deploying privileged pods to every node and installing a persistent systemd backdoor that polls for additional binaries, with exfiltrated data encrypted and sent to attacker-controlled domains

3

. Users should revert to versions 1.82.3 or 1.82.6 and monitor outbound traffic to known attacker domains while rotating all secrets, tokens, and credentials as a precautionary measure.

Today's Top Stories

TheOutpost.ai

Your Daily Dose of Curated AI News

Don’t drown in AI news. We cut through the noise - filtering, ranking and summarizing the most important AI news, breakthroughs and research daily. Spend less time searching for the latest in AI and get straight to action.

© 2026 Triveous Technologies Private Limited
Instagram logo
LinkedIn logo