March 24, 2026
Blog
Zeyan Liu
Back to Blog

Supply Chain Attack on LiteLLM: What Happened and Why It Matters

Scantist identified a major supply chain attack targeting LiteLLM

On March 24, 2026, Scantist identified a major supply chain attack targeting LiteLLM, a widely used Python library for routing requests across multiple large language model providers. Two compromised releases, versions 1.82.7 and 1.82.8, were uploaded to PyPI containing credential-stealing malware capable of spreading across cloud infrastructure and Kubernetes clusters.

This incident highlights a growing trend: attackers are increasingly targeting AI infrastructure and developer tooling — environments that often hold high-value credentials and production access.

Affected Packages

Package Name Version(s) Publication Date Injection Vectors Status
litellm 1.82.7 2026-03-24 proxy_server.py (import-time) Removed from PyPI
litellm 1.82.8 2026-03-24 proxy_server.py (import-time) + litellm_init.pth (interpreter startup) Removed from PyPI
Last known clean version: litellm@1.82.6 (published 2026-03-22, verified clean by Scantist).

What Happened

Security researchers discovered that LiteLLM versions 1.82.7 and 1.82.8 contained malicious code that did not exist in the upstream GitHub repository. This strongly suggests that publishing credentials were compromised and malicious packages were uploaded directly to PyPI, bypassing the normal release pipeline.

Version 1.82.8 introduced a particularly dangerous technique. A .pth file named litellm_init.pth was included in the package. Python automatically executes .pth files whenever the interpreter starts, meaning the malware ran every time Python launched — even if LiteLLM was never imported.

This turned the compromise into an environment-wide attack.

What the Malware Did

The malicious payload operated in three stages.

Stage 1 — Credential Harvesting

The malware collected sensitive information including:

  • SSH keys
  • .env files
  • AWS, GCP, and Azure credentials
  • Kubernetes configs
  • Database passwords
  • Crypto wallet files
  • TLS certificates
  • CI/CD secrets
  • Shell history

It also queried cloud metadata endpoints and dumped environment variables, allowing attackers to harvest infrastructure-level secrets.

Stage 2 — Kubernetes Lateral Movement

If Kubernetes access was detected, the malware:

  • Enumerated cluster nodes
  • Created privileged pods
  • Mounted host filesystem
  • Installed backdoors on every node

Pods were deployed under kube-system using names like node-setup-*. This allowed full cluster compromise, which is especially dangerous for AI workloads that commonly run in Kubernetes environments.

Stage 3 — Persistent Backdoor

The malware installed persistence files:

  • ~/.config/sysmon/sysmon.py
  • ~/.config/systemd/user/sysmon.service

After installation, the backdoor:

  • Waited five minutes
  • Polled attacker infrastructure every 50 minutes
  • Downloaded additional payloads
  • Executed silently

This allowed long-term persistence even after the initial compromise.

Data Exfiltration

Collected credentials were encrypted using AES-256 and protected with RSA-4096, packaged as tpcp.tar.gz, and exfiltrated to attacker-controlled domains:

  • models.litellm.cloud
  • checkmarx.zone

These indicators match infrastructure previously associated with the TeamPCP threat actor, which has been conducting a multi-ecosystem supply chain campaign.

Why LiteLLM Was Targeted

LiteLLM is widely used across AI applications and infrastructure. With tens of millions of downloads monthly, it often runs in environments containing:

  • LLM provider API keys
  • Cloud credentials
  • CI/CD tokens
  • Production infrastructure access

Compromising LiteLLM gives attackers access to high-value environments. This illustrates the growing “security-tool paradox” — tools that require broad access to function become high-impact targets when compromised.

Part of a Larger Campaign

This attack appears to be part of a broader campaign spanning multiple ecosystems:

  • February 28 — Trivy compromise
  • March 19 — npm worm deployment
  • March 22 — Docker Hub compromise
  • March 23 — Checkmarx KICS compromise
  • March 24 — LiteLLM compromise

Attackers appear to be chaining credentials from one compromise to pivot into the next environment.

How It Was Discovered

Engineers noticed Python processes crashing and spawning exponentially. The malicious .pth file triggered repeatedly, creating a fork bomb that crashed systems.

Ironically, this bug in the malware helped researchers detect the compromise early.

Who Is Affected

You may be affected if you installed LiteLLM on or after March 24, 2026 and are using:

  • 1.82.7
  • 1.82.8

The last known clean version is 1.82.6.

Immediate Actions

Check installed version:

pip show litellm

Search for malicious file:

find ~/.cache -name "litellm_init.pth"

Check persistence artifacts:

  • ~/.config/sysmon/sysmon.py
  • ~/.config/systemd/user/sysmon.service

Check Kubernetes clusters:

kubectl get pods -n kube-system | grep node-setup

If Compromised

Assume credential exposure and rotate:

  • SSH keys
  • Cloud credentials
  • API keys
  • Database passwords
  • Kubernetes tokens
  • CI/CD tokens

Remove persistence:

  • systemctl --user stop sysmon.service
  • systemctl --user disable sysmon.service

Lessons for AI Security

This attack highlights several important trends shaping today’s threat landscape. AI infrastructure is increasingly becoming a primary target, reflecting its growing role in modern systems and the value of the data it processes. At the same time, supply chain attacks continue to rise, allowing attackers to compromise widely used dependencies and propagate malicious code at scale. Security tools themselves are now high-value targets, as breaching them can provide deep visibility into protected environments. Additionally, credential chaining is becoming more common, enabling attackers to escalate access across systems by leveraging previously harvested secrets.

What Could Happen Next

Researchers expect this activity to continue evolving, with more frequent compromises of package registries and the emergence of self-propagating supply chain worms capable of spreading across ecosystems with minimal friction. Attackers are also likely to adopt more decentralized command-and-control infrastructure, making detection and takedown significantly harder. At the same time, broader harvesting of production credentials will further amplify the impact of such campaigns, enabling deeper access into critical systems. Taken together, these developments suggest that the campaign is not an isolated incident but part of an ongoing and expanding threat.

Final Thoughts

The LiteLLM compromise is not just another package attack. It represents a shift toward targeting AI infrastructure and developer tooling at scale.

As AI adoption accelerates, dependency security becomes increasingly critical. Organizations must treat dependencies as part of their attack surface and implement stronger supply chain security practices.

At Scantist, we continue monitoring emerging supply chain threats and helping organizations detect malicious packages, secure dependencies, and protect AI infrastructure.

In the AI era, your dependencies are part of your attack surface.

Back to Blog