
On March 24, 2026, Python package litellm (versions 1.82.7 and 1.82.8) was compromised in a sophisticated supply chain attack by threat actor TeamPCP, linked to LAPSUS$. The campaign began March 19 with the Trivy tooling breach and spread through npm, GitHub Actions, Checkmarx KICS, and PyPI. Malicious packages were live for two hours, potentially impacting millions, targeting developer and AI environments rich in secrets but poorly monitored.
1. HOW THE ATTACK HAPPENED
Attack Timeline & Progression
Stage 1: March 19, 2026 - Trivy Compromise (Starting Point)
Target:
trivysecurity scanning tool by Aqua SecurityCompromised Releases:
v0.69.4published on GitHub Container Registry, ECR Public, Docker Hub, and via package managers (deb/rpm)Mechanism: Threat actor used compromised credentials to force-push 76 of 77 tags and replace all seven
aquasecurity/setup-trivyversions with malicious buildsPayload Action: Dumped GitHub Runner worker memory, scraped credential locations, encrypted data with AES+RSA, exfiltrated to
scan.aquasecurty.org(look-alike domain)
Stage 2: March 20-22, 2026 - Campaign Expansion
npm Worm Deployment: Threat actor deployed self-propagating worm across 28 packages in
@EmilGroup, 16 in@opengov, and various other scoped npm registriesCredential Harvesting: Worm stole npm tokens, resolved which packages each token could publish, bumped patch versions, preserved original READMEs, and republished with malicious payloads
Kubernetes Focusing (March 22): Deployed scripts that split victims by timezone/locale - on Iranian systems deployed destructive "kamikaze" containers, on others installed persistent backdoors
Stage 3: March 23, 2026 - Checkmarx & OpenVSX Compromise
Targets:
Checkmarx/kics-github-actionCheckmarx/ast-github-actionOpenVSX extensions
ast-results 2.53.0andcx-dev-assist 1.7.0
Payload: Credential exfiltration with fallback mechanisms (if direct C2 failed, created public
docs-tpcprepositories with stolen GitHub tokens)
Stage 4: March 24, 2026 - LiteLLM Compromise
Affected Versions:
litellm 1.82.7and1.82.8released on PyPIAttack Vector: Same pattern as previous stages - stolen credentials from earlier compromises were used to publish malicious releases
Duration: Available for ~2 hours before PyPI quarantine, but millions of downloads per day means significant exposure window
2. ATTACKER PROFILE & MOTIVATION
Threat Actor: TeamPCP
Attribution Link: Associated with LAPSUS$, known for compromising organizations including Lulzsec connections
Tactics:
Repeated use of stolen CI/CD credentials across vendors (Aqua Security, Checkmarx, npm publishers)
Focus on developer environments and AI infrastructure
Targeting "high-leverage" packages in the AI stack
Motivation: Credential harvesting from developer environments where secrets live in abundance with less monitoring than production systems
Why Litellm?
Position in AI Stack: Unified interface for apps interacting with LLMs, calling models from OpenAI, Anthropic, Google, etc.
Secret Access: Typically sits between applications and AI service providers, giving access to API keys, environment variables, and sensitive configuration
Adoption: Millions of daily downloads made it highly attractive for maximizing blast radius
Trust Factor: Widely trusted package meant malicious code could bypass security filters
3. PAYLOAD ANALYSIS
Multi-Stage Payload Structure
Layer 1: Launcher & Data Exfiltration
Executes immediately upon installation
Uses base64-encoded, obfuscated Python code
Encrypts collected data with AES-256-CBC + random session key
Session key encrypted with hard-coded RSA public key
Packages as
tpcp.tar.gzfor exfiltration
Layer 2: Credential Harvesting
Targets include:
SSH keys and configurations
Git credentials
Cloud provider credentials (AWS, GCP, Azure)
Kubernetes configs and service account tokens
Environment files (.env)
Terraform, Helm, CI/CD artifacts
API keys and webhook URLs
Cryptocurrency wallet data
Layer 3: Persistence & C2
Writes
~/.config/sysmon/sysmon.pyInstalls systemd unit
sysmon.servicePolls remote endpoint every 50 minutes:
https://checkmarx[.]zone/raw/Downloads
/tmp/pglogand executes follow-on payloadsSandevoying tactic: Returns "Bad Apple!!" video link when Sonatype researchers attempt sandbox analysis
Version-Specific Implementation
Version 1.82.7
Payload injected in
litellm/proxy/proxy_server.pyExecutes when vulnerable package is imported in application
Requires explicit import of proxy module (e.g., LiteLLM proxy deployments)
Version 1.82.8 (MORE DANGEROUS)
Includes new
litellm_init.pthfile inside wheelFrom Python site docs, executable lines in
.pthfiles run during interpreter startupImpact: Executes automatically when Python interpreter starts, regardless of what code is imported
4. INDICATORS OF COMPROMISE (IOCs)
Malicious Domains
Domain | IP Address | Purpose |
|---|---|---|
| - | Primary C2 exfiltration endpoint |
| - | Alternative C2 domain |
| 83.142.209.11 | Secondary C2/fallback |
| 45.148.10.212 | Credential exfiltration (look-alike) |
Malicious File Artifacts
Malicious Kubernetes Artifacts
Affected Packages Summary
Python (PyPI)
litellm1.82.7, 1.82.8 ⚠️ CRITICALNote: Docker image
aquasec/trivy0.69.4-0.69.6 also compromised
GitHub Actions
aquasecurity/setup-trivy0.2.0 to 0.2.6aquasecurity/trivy-actionAll tags not starting with v, except 0.35.0Checkmarx/kics-github-actionv1.1Checkmarx/ast-github-actionv2.3.28
npm (Worm Deployments)
Notable compromised packages:
@pypestream/floating-ui-dom2.15.1@leafnoise/mirage2.0.3@opengov/ppf-backend-types1.141.2eslint-config-ppf0.128.2And ~40+ additional packages across multiple scopes
5. DETECTION STRATEGIES
Network-Based Detection
Endpoint Detection
Kubernetes Detection
EDR/Hunting Queries
DNS queries:
Kubernetes audit:
Secret access patterns:
6. MITIGATION & RESPONSE STRATEGIES
Immediate Actions (First 1 Hour)
1. Isolate Potentially Affected Systems
2. Rotate ALL Potentially Exposed Credentials
Prioritize:
Cloud credentials (AWS, Azure, GCP)
Kubernetes service account tokens
CI/CD tokens (GitHub, GitLab, etc.)
SSH keys for production servers
Database connection strings
API keys and webhook URLs
3. Hunt for Persistence Mechanisms
4. Review CI/CD Pipelines
Audit all active branches for requirements.txt, pyproject.toml, Pipfile
Check Dockerfiles for vulnerable dependencies
Review GitHub Actions workflows for malicious package references
Verify no production deployments used compromised versions
Short-Term (First 24-48 Hours)
1. Automated Scanning
Use GitGuardian's litellm_analyzer script to automate discovery:
2. EDR Deployment on Developer Machines
Install endpoint protection on all developer workstations
Monitor for outbound connections to C2 domains
Alert on suspicious Python interpreter activity
3. Supply-Chain Firewall Implementation
Implement tools like Datadog's SCFW that wrap pip install and block known malicious packages:
Transparent intercept of dependency resolution
Automatic blocking of quarantined/quarantinable packages
Low-friction developer workstation protection
Long-Term (Continuous Improvement)
1. Dependency Pinning & Verification
2. Continuous Secret Scanning
Deploy secret scanning in CI/CD pipelines
Configure alerts for sensitive data commits
Integrate with existing secret management infrastructure
3. Least Privilege Credential Management
Implement short-lived credentials where possible
Use service accounts instead of personal tokens
Regular credential rotation automation
Just-in-time access provisioning
4. Supply Chain Security Monitoring
Monitor for unusual package releases on PyPI/npm/etc.
Subscribe to security advisories from upstream projects
Implement automated vulnerability assessment
7. AFFECTED ORGANIZATIONS & SCALE
Impact Assessment
Daily Downloads: ~3 million times per day (per Sonatype)
Duration of Exposure: ~2 hours before PyPI quarantine
Estimated Exposed Systems: Tens of thousands to potentially millions across:
Developer workstations
CI/CD runners
Container hosts
Kubernetes clusters
Production services with floating dependencies
Critical Considerations
Version 1.82.8 is higher risk due to
.pthfile executing on interpreter startup regardless of importsVersion 1.82.7 requires import of proxy module specifically
CI/CD pipelines especially vulnerable because they often share credentials with production systems
Kubernetes environments particularly dangerous due to cluster-wide credential access potential
8. KEY LESSONS & RECOMMENDATIONS
What We Learned from This Attack
Developer Environment Monitoring: Developer workstations are high-value targets with secrets and insufficient monitoring
Supply Chain Trust Blind Spots: Organizations trust widely-used packages without rigorous verification processes
Credential Reuse Across Ecosystems: Compromised credentials from one tool (Trivy) enable attacks across multiple platforms (npm, PyPI, Checkmarx)
AI Stack as Target: Attackers are specifically targeting the AI development ecosystem where valuable API keys and data flow
Best Practices Going Forward
Pin Dependency Versions: Never use floating versions for critical dependencies
Monitor Package Registries: Subscribe to security advisories from PyPI, npm, etc.
Implement Supply-Chain Firewalls: Deploy tools that intercept and block malicious packages
Regular Credential Audits: Periodically review which credentials are accessible from each environment
Developer Endpoint Protection: Treat developer machines with production-level monitoring
CI/CD Security: Secure build pipelines with the same rigor as production systems
9. RESOURCES FOR ORGANIZATIONS
Official Sources
Datadog Security Labs: https://securitylabs.datadoghq.com/articles/litellm-compromised-pypi-teampcp-supply-chain-campaign/
Sonatype Guide: https://guide.sonatype.com/vulnerability/sonatype-2026-001357
GitGuardian IOC Script: https://github.com/GitGuardian/litellm_analyzer
IOC Downloads
DataDog IOCs CSV: https://github.com/DataDog/indicators-of-compromise/tree/main/teampcp
Security Community
Futuresearch Analysis: https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/
Armosec Backdoor Analysis: https://www.armosec.io/blog/litellm-supply-chain-attack-backdoor-analysis/
10. CONCLUSION
The LiteLLM compromise represents a sophisticated, multi-stage supply chain attack targeting the AI development ecosystem. Key lessons:
Developer environments are prime targets - Secrets live there with insufficient monitoring
Trust but verify - Even widely-trusted packages need verification
Supply chains cascade - Compromised credentials in one tool enable attacks across platforms
Rapid response matters - Organizations must have detection capabilities for malicious domains/files
The attack demonstrates that attackers are increasingly targeting high-value targets in emerging technologies like AI, where credential density is high and security monitoring may be less mature than production systems.
Immediate Action Required: All organizations should:
Check EDR logs for connections to malicious domains
Audit CI/CD for compromised package versions
Rotate credentials from affected systems
Remove persistence mechanisms
Implement continuous supply chain monitoring
Report compiled March 26, 2026 based on analysis of security advisories from Datadog, Sonatype, GitGuardian, and other security researchers.
Understand how ATLAS Cyber offers word class detection and response with 0 false positives.