# LiteLLM supply chain compromise: malicious litellm 1.107.0 on PyPI, GHCR and Docker Hub delivers credential stealer and RAT

> On 2026-10-21 an attacker used stolen developer GitHub CLI credentials to run LiteLLM's private release workflow against the lookalike fork Berri-AI/litellm. They published litellm 1.107.0 to PyPI and Docker images to GHCR and Docker Hub. The artifacts add cook.pth, cook.py and sitecustomize.py to site-packages, which steal cloud, developer and AI-tool credentials on every Python start and run an hourly dead-drop-driven remote code loader.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-03T18:11:02Z
- **Last updated:** 2026-12-03T18:11:02Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7415
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7415.png
- **ID:** TL-2026-7415
- **Severity:** CRITICAL
- **Category:** SUPPLY_CHAIN
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 27 (3 shown free below)

## Description

On 2026-10-21 malicious litellm==1.107.0 (seven wheels) was uploaded to PyPI at about 11:39 UTC. Docker images tagged v1.107.0, latest, main-latest and main-stable were published to GHCR and Docker Hub at about 11:46 UTC from the same build. The official v1.107.0 source tag on GitHub does not contain the malicious content. The payload is injected at build time: a commit added data = "cook" under [tool.maturin] in pyproject.toml (packaging a cook/ directory that exists only in the compromised build environment), and a later commit added COPY cook ./cook to the Dockerfiles. A review of the tagged source alone would therefore miss it. LiteLLM application code was not modified.

According to LiteLLM's incident post, a privileged developer credential was used at 10:08 UTC to override branch protection and commit a change to the private release workflow. A staging run then executed against the attacker-controlled lookalike repository Berri-AI/litellm (one hyphen different from BerriAI/litellm) at commit 20535d8fa11f786a6c24df7488a0e449ed5f09ad. A second developer credential approved the production gate at 11:11 UTC. A third credential was used at about 11:53 UTC to delete workflow run records. The artifacts were published through normal channels with build provenance recording Berri-AI as the source owner. Datadog attributes the access to stolen GitHub CLI OAuth tokens from three engineers; one token belonged to a GitHub organization owner. How the tokens were first obtained is not established. LiteLLM reports an unexpected user account on an internal, internet-exposed LiteLLM deployment and suspects the tokens were taken from its logs, possibly through a recently patched vulnerability (unconfirmed). StepSecurity reports a different earlier chain: a master key for an internal agent platform committed to a public repo on 2026-05-27 and never revoked returned an organization owner's CLI token on 2026-10-10, followed by malicious ci-tmp-* workflows exfiltrating CI secrets to webhook.site. These accounts have not been reconciled. LiteLLM also believes the private half of its previous cosign key was exposed and rotated it on 2026-10-23.

The wheels install three files into site-packages. cook.pth (12 bytes, 'import cook') runs cook.py at every Python or pip start, with no import of litellm needed. cook.py decodes a roughly 61 KB Base64+zlib collector (tool tag 'privcollect') that runs in a daemon thread, sets PRIVCOLLECT_ACTIVE=1, and runs 16 collection modules. These cover AWS/Azure/GCP credentials and instance metadata, Kubernetes, Docker, Vault, Terraform, SSH/GPG/TLS keys, Git/npm/PyPI/.netrc/.env secrets, browser passwords and cookies, shell history, /proc/<pid>/environ for all readable processes, and AI-tool credentials (Claude, Codex, Gemini, Cursor, Copilot and others). If DATABASE_URL is set it queries LiteLLM_CredentialsTable and LiteLLM_ProxyModelTable for upstream provider keys. AWS credentials are validated with STS GetCallerIdentity. Results are packed into a tar.gz (hdr.json, data.bin, key.bin), encrypted with a random AES-256-CBC key wrapped under an embedded RSA-4096 public key (OAEP-SHA256), and POSTed over plain HTTP to http://www.litellm.dev/healthcheck with an X-Token header, an X-SHA256 body hash and a spoofed MSIE 7.0 User-Agent. litellm.dev was registered on 2026-10-13. A marker /tmp/.pc_once_72129118c59f5636c0bb is written only after an HTTP 200, so the stealer retries on every Python start until upload succeeds.

sitecustomize.py implements the RAT/loader. On Linux and macOS it takes the lock /tmp/remote_code_loader.lock, forks a detached daemon (setsid, cwd /, streams to /dev/null) and about every 3,600 seconds reads a hostname from the GitHub dead drop raw.githubusercontent.com/letters9813/pythonclient-test/main/domain.txt. It then downloads Python from http://<host>/codepy and exec()s it with no signature or hash check. The dead drop held only test values (localhost:18909, test.test.com:18909) and was empty at 13:01 UTC, and no second-stage payload has been observed. The GitHub account was removed. On Windows the loader fails silently (no fcntl/os.fork) but the stealer still runs. StepSecurity reports that stolen AWS instance-role credentials were later used from 168.100.8.57 and 165.227.201.8 for GetCallerIdentity, bedrock:ListFoundationModels and CloudTrail reconnaissance (2026-10-21 16:20-17:01 UTC), consistent with LLMjacking.

Exposure windows: PyPI wheels live 11:39:51-13:23 UTC (Datadog reports PyPI quarantine at 13:20); GHCR tags until about 13:51 UTC; Docker Hub tags until about 14:20 UTC (Datadog reports Docker images removed at 13:53). Removing the litellm package directory does not remove the dropped files, and running python or pip re-triggers the malware. No actor is named. Datadog states no connection to the earlier litellm 1.82.7/1.82.8 incident (March 2026, attributed to TeamPCP via a compromised Trivy action) has been established, and the delivery method, infrastructure and tooling differ.

## MITRE ATT&CK

- T1195.002 Compromise Software Supply Chain
- T1078 Valid Accounts
- T1583.001 Domains
- T1059.006 Python
- T1546.018 Python Startup Hooks
- T1685 Disable or Modify Tools
- T1036.005 Match Legitimate Resource Name or Location
- T1027.013 Encrypted/Encoded File
- T1528 Steal Application Access Token
- T1552.001 Credentials In Files
- T1552.004 Private Keys
- T1552.005 Cloud Instance Metadata API
- T1555.003 Credentials from Web Browsers
- T1082 System Information Discovery
- T1580 Cloud Infrastructure Discovery
- T1005 Data from Local System
- T1102.001 Dead Drop Resolver

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**LiteLLM privcollect Exfiltration, GitHub Dead-Drop Poll and /codepy Loader Fetch over HTTP (Zeek)** (`TL-2026-7415-SPL-003`)

Detects network behaviour of the litellm 1.107.0 compromise (TL-2026-7415): HTTP to litellm.dev / www.litellm.dev (attacker-registered 2026-10-13), the plain-HTTP POST to /healthcheck with a spoofed MSIE 7.0 User-Agent carrying encrypted credential archives, the hourly dead-drop poll of raw.githubusercontent.com/letters9813/pythonclient-test/main/domain.txt used by sitecustomize.py to resolve its C2 host, and a request to /codepy whose response the loader exec()s without verification.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1041, T1102.001, T1105, T1583.001
- **Data sources:** zeek_http, network_proxy, defender_network_events
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

````spl
index=network sourcetype="bro:http:json" earliest=-24h (host IN ("litellm.dev","www.litellm.dev") OR (host="raw.githubusercontent.com" uri="/letters9813/pythonclient-test/*") OR (method=POST uri="/healthcheck" user_agent="*MSIE 7.0*") OR uri="/codepy")
```exfil domain, GitHub dead drop, healthcheck POST, codepy loader fetch```
| eval indicator=case(like(host,"%litellm.dev"),"exfil_domain_litellm.dev",like(uri,"/letters9813/%"),"github_dead_drop_poll",uri="/codepy","remote_code_fetch_codepy",true(),"healthcheck_post_msie7")
| rename "id.orig_h" as src_ip "id.resp_h" as dest_ip
| stats count min(_time) as first_seen max(_time) as last_seen values(host) as hosts values(uri) as uris values(user_agent) as user_agents values(dest_ip) as dest_ips by src_ip indicator
| convert ctime(first_seen) ctime(last_seen)
````

### Microsoft KQL

```kql
let exfilDomains = dynamic(["litellm.dev", "www.litellm.dev"]);
let iocIps = dynamic(["69.48.229.143", "199.91.221.39"]);
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteUrl has_any (exfilDomains)
    or RemoteUrl has "raw.githubusercontent.com/letters9813/pythonclient-test"
    or RemoteUrl endswith "/codepy"
    or RemoteIP in (iocIps)
| extend Indicator = case(RemoteUrl has "litellm.dev", "exfil_domain_litellm.dev", RemoteUrl has "letters9813", "github_dead_drop_poll", RemoteUrl endswith "/codepy", "remote_code_fetch_codepy", "known_attacker_ip")
| project Timestamp, DeviceName, Indicator, RemoteUrl, RemoteIP, RemotePort, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
```

### Sigma

```yaml
title: LiteLLM privcollect Exfiltration, GitHub Dead Drop and codepy Loader Fetch via Proxy
id: 8e4a6b30-1d7f-4c29-b5a3-7f0e92c8d303
status: experimental
description: Detects web proxy requests to the attacker-controlled litellm.dev exfiltration domain, the plain-HTTP /healthcheck POST using a spoofed MSIE 7.0 User-Agent, polling of the letters9813/pythonclient-test GitHub dead drop, and requests to /codepy, all associated with the litellm 1.107.0 compromise (TL-2026-7415).
references:
    - https://securitylabs.datadoghq.com/articles/litellm-compromised-pypi-docker/
    - https://www.stepsecurity.io/blog/litellm-1-107-0-compromised-pypi-backdoored-wheels-credential-stealer
author: Threadlinqs Team
date: 2026-12-03
tags:
    - attack.command-and-control
    - attack.t1102.001
    - attack.t1105
    - attack.exfiltration
    - attack.t1041
    - attack.resource-development
    - attack.t1583.001
logsource:
    category: proxy
detection:
    selection_exfil_apex:
        cs-host: 'litellm.dev'
    selection_exfil_sub:
        cs-host|endswith: '.litellm.dev'
    selection_healthcheck:
        cs-method: 'POST'
        c-uri|endswith: '/healthcheck'
        cs-user-agent|contains: 'MSIE 7.0'
    selection_deaddrop:
        cs-host: 'raw.githubusercontent.com'
        c-uri|contains: '/letters9813/pythonclient-test/'
    selection_codepy:
        c-uri|endswith: '/codepy'
    condition: 1 of selection_*
falsepositives:
    - Penetration testers or researchers replaying the published indicators
    - A legitimate internal service that happens to expose a /codepy path
level: critical

```

**Known false positives:**

- Researchers or red teams replaying the published litellm.dev indicators
- An internal web application that legitimately serves a /codepy path

**Tuning notes:** Adjust index and sourcetype to your Zeek or proxy data (for example pan:threat or bluecoat:proxysg:access:syslog). The /codepy branch is the weakest and may be scoped to egress from Python hosts. The GitHub dead-drop repo was removed and held only test values, so a hit still indicates the loader ran. Do not block all of raw.githubusercontent.com, only the specific path.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- LiteLLM 1.107.0 Malicious Package, Image Digest or Lookalike Berri-AI Repo Referenced in Process Command Line (locked: unlock with TL Creds)
- Known-Malicious litellm 1.107.0 Wheel, Sdist or privcollect File Hash Observed on Disk (locked: unlock with TL Creds)
- Python or pip Process Probing Cloud Metadata and Connecting to [indicator] Exfiltration Infrastructure (locked: unlock with TL Creds)
- GitHub Release Workflow Tampering: Lookalike Berri-AI Repo, Branch Protection Override or Workflow Run Deletion (locked: unlock with TL Creds)
- Python Startup Hook (sitecustomize.py / usercustomize.py / cook.pth) Dropped into Third-Party site-packages (locked: unlock with TL Creds)
- DNS Resolution of LiteLLM privcollect Exfiltration Domain [indicator] (locked: unlock with TL Creds)
- LiteLLM 1.107.0 privcollect Startup-Hook Artifacts Written to site-packages or /tmp (Linux/macOS) (locked: unlock with TL Creds)
- Stolen AWS Instance-Role Credentials Used for Recon from Attacker or External IPs (LiteLLM privcollect LLMjacking) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 27)

Defanged, TLP:CLEAR.

- IP address: `69.48.229[.]143`
- Domain: `litellm[.]dev`
- URL: `hxxps://github[.]com/Berri-AI/litellm`

Full set of 27 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [LiteLLM supply chain compromise: What you need to know (Datadog Security Labs)](https://securitylabs.datadoghq.com/articles/litellm-compromised-pypi-docker/)
- [LiteLLM v1.107.0 security incident analysis (LiteLLM)](https://docs.litellm.ai/blog/security-incident-oct-21-2026)
- [litellm 1.107.0 compromised: PyPI backdoored wheels, credential stealer (StepSecurity)](https://www.stepsecurity.io/blog/litellm-1-107-0-compromised-pypi-backdoored-wheels-credential-stealer)
- [LiteLLM PyPI Package and Docker Images Compromised to Steal Cloud and AI Credentials (Socket)](https://socket.dev/blog/litellm-compromise)
- [litellm 1.107.0 compromised: Python startup hooks steal cloud, AI and proxy credentials (Endor Labs)](https://www.endorlabs.com/learn/litellm-1-107-0-compromised-python-startup-hooks-steal-cloud-ai-and-proxy-credentials)
- [litellm compromised: infostealer and RAT (Aikido)](https://www.aikido.dev/blog/litellm-compromised-infostealer-rat)
- [litellm release pipeline hacked to distribute info stealer malware (BleepingComputer)](https://bleepingcomputer.com/news/security/litellm-release-pipeline-hacked-to-distribute-info-stealer-malware)
- [LiteLLM supply chain attack hoovers up passwords and secrets (The Register)](https://theregister.com/security/2026-10-21/litellm-supply-chain-attack-hoovers-up-passwords-and-secrets/5304548)
- [litellm 1.107.0 compromised (Mend)](https://mend.io/blog/litellm-1-107-0-compromised)
- [How a Poisoned Security Scanner Became the Key to Backdooring LiteLLM (Snyk) - earlier 1.82.7/1.82.8 incident, TeamPCP, March 2026](https://snyk.io/articles/poisoned-security-scanner-backdooring-litellm)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7415
