LiteLLM hit by supply chain attack that turns Python library into credential-stealing backdoor

2 Sources

Share

Two versions of LiteLLM, a widely-used Python library for accessing large language models, were compromised with malicious code that steals SSH keys, cloud tokens, and crypto wallets. The supply chain attack originated from a Trivy vulnerability scanner compromise, with threat actor TeamPCP exploiting CI/CD pipelines to inject a three-stage credential stealer that executes automatically on every Python process startup.

News article

LiteLLM Compromise Exposes Critical Open-Source Security Risk

Two versions of LiteLLM have been removed from PyPI after a supply chain attack injected them with credential stealing malware that operates as a backdoor to entire systems

1

. The popular Python library, which provides a unified interface for accessing multiple large language models and has over 40,000 stars on GitHub, saw versions 1.82.7 and 1.82.8 infected with malicious code designed to harvest sensitive data from developer machines

2

.

The LiteLLM compromise represents a significant escalation in attacks targeting AI development infrastructure, affecting anyone working with AI APIs and local LLMs through this widely-adopted dependency.

CI/CD Pipeline Compromise Through Trivy Vulnerability Scanner

The attack chain began with a misconfiguration in Trivy's GitHub Actions environment, according to Aqua Security

1

. Trivy, an open-source vulnerability scanner maintained by Aqua Security and used by numerous projects as a security measure, became the entry point for attackers in late February when they exploited the misconfiguration to obtain stolen access tokens with privileged access.

Krrish Dholakia, CEO of Berri AI which maintains LiteLLM, confirmed the compromise originated from Trivy usage in the project's CI/CD pipeline

1

. The attackers, identified as TeamPCP, published malicious Trivy release v0.69.4 on March 19, followed by versions v0.69.5 and v0.69.6 as DockerHub images on March 22

1

.

What made this CI/CD pipeline compromise particularly sophisticated was the attackers' approach to existing infrastructure. Rather than simply uploading new malicious versions, TeamPCP modified existing version tags associated with the trivy-action GitHub Action script, injecting malicious code into workflows already running in production environments

1

. Because many pipelines rely on version tags rather than pinned commits, these systems continued executing without any indication the underlying code had changed.

Three-Stage Credential Stealer Deployed via Malicious Versions on PyPI

The malicious payload in the compromised LiteLLM versions operates as a three-stage credential stealer with unprecedented reach

2

. Version 1.82.8 contains a file called "litellm_init.pth" that executes automatically on every Python process startup, meaning simply having it installed is enough to trigger the malicious payload without even importing the library

2

. Version 1.82.7 requires an import for activation but remains equally dangerous.

The comprehensive theft of SSH keys and cloud tokens includes AWS credentials, GCP service account tokens, Azure secrets, Kubernetes configurations, database passwords, shell history, and crypto wallets

2

. The malware also queries cloud metadata endpoints, extracting instance credentials from EC2 instances and GKE pods. Additional targets include environment variables containing API keys and secrets, Git credentials, Docker configs, package manager configurations, SSL/TLS private keys, and CI/CD secrets from terraform.tfvars, GitLab, Travis, Jenkins, and Ansible files

2

.

The compromise was discovered by chance 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

.

TeamPCP's Expanding Campaign and Attribution Evidence

A commit pushed to one of the LiteLLM maintainer's forked repositories reads "teampcp owns BerriAI," serving as a blunt calling card

2

. TeamPCP is the same threat actor responsible for compromising Aqua Security's Trivy on March 19 and Checkmarx's KICS GitHub Action on March 23

2

.

The technical overlap across these incidents follows a consistent playbook: compromise maintainer accounts or credentials, push malicious versions to package registries, and deploy multi-stage credential stealers. With KICS, TeamPCP hijacked numerous release tags in under four hours

2

. The Python library malware shares the same encryption scheme and exfiltration pattern seen in the Trivy attack.

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

1

. The team has deleted all PyPI publishing tokens and is reviewing security measures including trusted publishing via JWT tokens

1

.

Immediate Actions Required and Future Implications

The Python Packaging Authority has published 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 revoke or rotate them accordingly

1

.

This incident highlights vulnerabilities in dependency management practices across the AI development ecosystem. The fact that many organizations rely on version tags rather than pinned commits in their CI/CD workflows creates exploitable attack surfaces. Security researchers are watching whether TeamPCP will continue targeting AI infrastructure components, and whether the GitHub vulnerability report spam attack—where 19 of 25 accounts posting AI-generated "Thanks, that helped!" comments were also used in the Trivy spam campaign—signals new obfuscation tactics

1

.

Organizations using LiteLLM as a dependency should audit their systems for the compromised versions, rotate all credentials, and implement stricter CI/CD security controls including commit pinning and enhanced token management practices.

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