LiteLLM: Supply chain compromise of version 1.107.0
The LiteLLM Python package version 1.107.0 was compromised via stolen GitHub CLI OAuth tokens to distribute a credential-stealing backdoor that harvests cloud and developer secrets.
Triage facts
Revision 1- Applicability
- LiteLLM (1.107.0)
- Evidence
- Unknown
- Severity
- High
- Action
- Immediate escalation
- Sources
- 1 public source
- Freshness
- Revision 1Oct 21, 19:06 UTC
- Detection
- 1 rule · 1 IOC
- Source quality
- A1Very likely
LiteLLM version 1.107.0 was identified as malicious, having been distributed via PyPI and Docker images containing unauthorized code. The compromise occurred through the theft of GitHub CLI OAuth tokens belonging to three project engineers, which allowed the threat actor to trigger and approve a malicious release. All affected tokens have been revoked, and the organization is currently migrating to a more secure account management structure.
Attack Chain
- Threat actor obtains GitHub CLI OAuth tokens belonging to three project engineers.
- Threat actor uses one compromised account to trigger a project-releaser run.
- Threat actor uses a second compromised account to approve the malicious release.
- Malicious LiteLLM 1.107.0 package is published to PyPI and Docker Hub.
- User installs or updates the malicious LiteLLM package.
- Python interpreter loads the malicious 'cook.pth' file upon startup.
- 'cook.pth' triggers the 'privcollect' payload to harvest cloud tokens, keys, and browser data.
- Background daemon checks a GitHub-hosted dead drop for further instructions and executes returned Python code.
Impact
Successful exploitation results in the unauthorized exfiltration of cloud credentials, SSH private keys, browser data, and authentication files for various AI development tools. Collected data is exfiltrated as a GZIP-compressed TAR archive via HTTP POST requests to 'litellm.dev/healthcheck'.
Recommendation
- Pin dependencies to version 1.106.2 using cryptographic digests to prevent accidental installation of compromised versions.
- Review all environments where LiteLLM 1.107.0 was installed for signs of credential harvesting or persistent backdoors.
- Revoke and rotate all cloud credentials, API keys, and certificates present on systems that ran version 1.107.0.
- Monitor Python environments for the presence of files named 'cook.pth' or usage of the 'cook' module, which are indicative of this specific malware.
- Implement supply chain security practices such as ephemeral build environments and restricted permissions for GitHub CLI tokens used in automated release pipelines.
Immediate actions
Inventory all systems for LiteLLM 1.107.0
Revoke credentials present on systems that ran LiteLLM 1.107.0
Threat Hunt
Search for presence of 'cook.pth' in Python site-packages directories
Data: EDR file monitoring
Mitigations
Pin LiteLLM version to 1.106.2 using integrity digests
LiteLLM 1.107.0
Detection coverage 1
Detect Malicious LiteLLM Path File
highDetects the creation or presence of the malicious cook.pth file used by the LiteLLM 1.107.0 backdoor to execute code on interpreter startup.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
url
| Type | Value |
|---|---|
| url | https://litellm.dev/healthcheck |