LiteLLM 1.107.0 backdoor steals cloud and AI credentials
LiteLLM version 1.107.0 on PyPI and GHCR delivered malware through Python startup hooks (cook.pth, cook.py, sitecustomize.py). The payload collects: AWS/Azure/GCP/K8s credentials, GitHub CLI tokens, SSH/GPG…
What happened
LiteLLM version 1.107.0 on PyPI and GHCR delivered malware through Python startup hooks (cook.pth, cook.py, sitecustomize.py). The payload collects: AWS/Azure/GCP/K8s credentials, GitHub CLI tokens, SSH/GPG keys, AI tool credentials (Codex, Claude, Gemini, Cursor MCP, Copilot, etc.), browser data, LiteLLM proxy database credentials, and environment variables. Collector encrypts data with AES-256-CBC and exfiltrates to www.litellm.dev/healthcheck. A second loader downloads Python from GitHub-controlled domain for remote execution. Docker provenance showed lookalike repository Berri-AI/litellm (hyphenated) instead of legitimate BerriAI/litellm.
Supply chain attack targeting AI gateway, steals cloud/AI-tool/gateway credentials via Python startup hooks
How it happened
Read the flow as text & sources
A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.
- 01 · Compromised release workflow
Project release workflow used lookalike repository Berri-AI/litellm (hyphenated) instead of legitimate BerriAI/litellm; malicious commit added Maturin data directory; build provenance recorded source-owner override
Hunt: A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.
Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.
Source for step 1 - 02 · Malicious package distribution
Published litellm 1.107.0 to PyPI (7 wheels across macOS/Linux/Windows) and Docker images to GHCR with floating tags (latest, main-latest, main-stable)
Hunt: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.
Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.
Source for step 2 - 03 · Python startup hook installation
Wheels install cook.pth, cook.py, sitecustomize.py to environment's Python library directory; triggered automatically on any Python startup
Hunt: A package or installer creates sitecustomize.py, usercustomize.py, or a .pth startup hook in a Python environment, causing code to run during later interpreter starts.
Legitimate packages use .pth files and customization hooks. File telemetry must cover the relevant environment, and the rule does not establish that the hook later executed.
Source for step 3 - 04 · Credential collection
Collects AWS/Azure/GCP/K8s, AI tools (Codex/Claude/Gemini/Cursor/Copilot/Windsurf), SSH/GPG keys, browser data, LiteLLM proxy DB credentials, environment variables; 16 collection modules with individual error handling
Hunt: An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.
Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.
Source for step 4 - 05 · Encrypted exfiltration
Data encrypted with AES-256-CBC, key wrapped with RSA-4096 public key, packaged in gzip tar; POSTed to www.litellm.dev/healthcheck with X-Token header; up to 4 retry attempts
Hunt: Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.
An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.
Source for step 5 - 06 · Remote code loader
sitecustomize.py forks detached process; downloads domain.txt from GitHub repo letters9813/pythonclient-test; if domain resolves, downloads and executes Python from /codepy endpoint; 1-hour loop
Hunt: A package or installer creates sitecustomize.py, usercustomize.py, or a .pth startup hook in a Python environment, causing code to run during later interpreter starts.
Legitimate packages use .pth files and customization hooks. File telemetry must cover the relevant environment, and the rule does not establish that the hook later executed.
Source for step 6
Dashed edges show a repeated decision loop.
Why it matters
Reported entry point: Supply chain compromise: malicious wheels published to PyPI and Docker images to GHCR; project release workflow used lookalike source repository (Berri-AI/litellm with hyphen). Reported impact: Data encrypted with AES-256-CBC, key wrapped with RSA-4096 public key, packaged in gzip tar; POSTed to www.litellm.dev/healthcheck with X-Token header; up to 4 retry attempts; reported targets include LiteLLM users across ~23M weekly downloads; affects AI development, cloud deployments, CI/CD pipelines; applicability to your setup has not been assessed, so verify affected versions, permissions, and configuration in the original report.
What you can do
Protection & prevention
Block litellm==1.107.0 and affected image digests; Python startup hook monitoring; dependency pinning and artifact verification; registry tag floating risks; separate release credentials from installation environments; audit cloud/AI credentials
Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.
Detection queries
Draft query starters grouped by the attack stages where they apply.
Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.
01Compromised release workflowPrivate access → public repository artifactCustom schema · Draft
Project release workflow used lookalike repository Berri-AI/litellm (hyphenated) instead of legitimate BerriAI/litellm; malicious commit added Maturin data directory; build provenance recorded source-owner override
What to look for
A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.
Visibility: Defender-side logs where collected
Required logs
- Git-provider organization / enterprise audit
- Repository and token permission inventory
- Agent tool and secret-scanning / DLP records
Coverage limit. Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.
Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.
Sigma
title: Hunt - Private access → public repository artifact
id: b7b2d3f0-8170-4225-accb-c20633364ef4
status: experimental
description: A token or agent reads private material and creates a public issue,
repository, commit or visibility change inconsistent with the approved task.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
- Authorized activity matching this broad hunt; baseline and investigate
before alerting.
level: low
logsource:
category: application
product: openattacks_audit
definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
Target and CorrelationId from the required source logs first.
detection:
selection:
EventType:
- repository.public.write
- repository.visibility.change
condition: selection
KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("repository.public.write", "repository.visibility.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated descSPL
sourcetype="openattacks:audit"
EventType IN ("repository.public.write", "repository.visibility.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _timeInvestigation steps
- Join access and public-write actions by actor / token and time; inspect visibility changes and newly created repositories.
- Verify whether the artifact contains sensitive data using approved scanning, retaining original source qualifications.
02Malicious package distributionDependency / CI trust boundaryCustom schema · Draft
Published litellm 1.107.0 to PyPI (7 wheels across macOS/Linux/Windows) and Docker images to GHCR with floating tags (latest, main-latest, main-stable)
What to look for
A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.
Visibility: Defender-side logs where collected
Required logs
- Package-manager and CI job logs
- Lockfile / manifest / workflow diffs
- Runner process trees, secret access and egress
Coverage limit. Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.
Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.
Sigma
title: Hunt - Dependency / CI trust boundary
id: 5fa9c45a-ac1c-4666-a598-e80626320997
status: experimental
description: A package or workflow change introduces a lifecycle hook, remote
dependency or new command that accesses secrets or external services.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
- Authorized activity matching this broad hunt; baseline and investigate
before alerting.
level: low
logsource:
category: application
product: openattacks_audit
definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
Target and CorrelationId from the required source logs first.
detection:
selection:
EventType:
- package.install
- ci.workflow.change
- package.lifecycle.exec
condition: selection
KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated descSPL
sourcetype="openattacks:audit"
EventType IN ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _timeInvestigation steps
- Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
- Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
03Python startup hook installationPython startup-hook persistenceNative logs · Draft
Wheels install cook.pth, cook.py, sitecustomize.py to environment's Python library directory; triggered automatically on any Python startup
What to look for
A package or installer creates sitecustomize.py, usercustomize.py, or a .pth startup hook in a Python environment, causing code to run during later interpreter starts.
Visibility: Endpoint file telemetry where collected
Required logs
- File creation and modification events for Python library directories
- Package-manager and installer process trees
- Subsequent Python process and network activity
Coverage limit. Legitimate packages use .pth files and customization hooks. File telemetry must cover the relevant environment, and the rule does not establish that the hook later executed.
Python startup-hook file candidates. Tune approved packages and environments, then correlate the file event with interpreter execution.
MCP reference matches: Python Site or User Customize File Creation (Elastic detection-rules), Python Site Hooks Creation During Package Installation (Splunk Security Content). The query below is a catalog adaptation, not a verbatim upstream rule.
Sigma
title: Hunt - Python Startup Hook Creation
id: e229b088-94e8-4254-8bfb-fc1e03173def
status: experimental
description: Detects creation of Python customization or path startup hooks.
author: MagicSword OpenAttacks catalog
date: 2026-11-06
references:
- https://github.com/elastic/detection-rules/blob/main/rules/linux/persistence_site_and_user_customize_file_creation.toml
- https://github.com/splunk/security_content/blob/develop/detections/endpoint/python_site_hooks_creation_during_package_installation.yml
falsepositives:
- Legitimate Python package installation and environment management
level: medium
logsource:
category: file_event
detection:
selection_named_hook:
TargetFilename|endswith:
- /sitecustomize.py
- /usercustomize.py
selection_pth:
TargetFilename|contains:
- /site-packages/
- /dist-packages/
TargetFilename|endswith: .pth
condition: 1 of selection_*
KQL
DeviceFileEvents
| where Timestamp > ago(7d)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FileName in~ ("sitecustomize.py", "usercustomize.py")
or (FileName endswith ".pth" and FolderPath has_any ("/site-packages/", "/dist-packages/", "\\site-packages\\"))
| project Timestamp, DeviceName, InitiatingProcessAccountName, FolderPath, FileName,
InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1
| order by Timestamp descSPL
sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
(TargetFilename="*\\sitecustomize.py" OR TargetFilename="*\\usercustomize.py"
OR TargetFilename="*\\site-packages\\*.pth")
| table _time host User Image TargetFilename ProcessGuid
| sort - _timeInvestigation steps
- Inspect the hook contents, owner, package provenance, and creating process.
- Correlate later Python launches with child processes, credential access, or unexpected egress.
04Credential collectionSensitive store access → credential useCustom schema · Draft
Collects AWS/Azure/GCP/K8s, AI tools (Codex/Claude/Gemini/Cursor/Copilot/Windsurf), SSH/GPG keys, browser data, LiteLLM proxy DB credentials, environment variables; 16 collection modules with individual error handling
What to look for
An unexpected process or tool accesses credential stores and is followed by token use or outbound transfer inconsistent with the owner.
Visibility: Defender-side logs where collected
Required logs
- File-read / API access telemetry for relevant secret stores
- Process identity and command lines
- Identity, token and outbound-network audit logs
Coverage limit. Defender DeviceFileEvents is not a general file-read audit trail. Collect suitable object-access, EDR or application logs; legitimate developer tools also read secrets.
Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.
Sigma
title: Hunt - Sensitive store access → credential use
id: 46c46c62-2d83-4198-a8bf-d6637094527b
status: experimental
description: An unexpected process or tool accesses credential stores and is
followed by token use or outbound transfer inconsistent with the owner.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
- Authorized activity matching this broad hunt; baseline and investigate
before alerting.
level: low
logsource:
category: application
product: openattacks_audit
definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
Target and CorrelationId from the required source logs first.
detection:
selection:
EventType:
- secret.read
- credential.store.read
condition: selection
KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("secret.read", "credential.store.read")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated descSPL
sourcetype="openattacks:audit"
EventType IN ("secret.read", "credential.store.read")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _timeInvestigation steps
- Identify the actor, process and exact store touched, then pivot to token use from new devices or infrastructure.
- Correlate reads with egress and rotate affected credentials after confirming exposure.
05Encrypted exfiltrationSensitive data → unusual destinationCustom schema · Draft
Data encrypted with AES-256-CBC, key wrapped with RSA-4096 public key, packaged in gzip tar; POSTed to www.litellm.dev/healthcheck with X-Token header; up to 4 retry attempts
What to look for
Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.
Visibility: Defender-side logs where collected
Required logs
- Sensitive resource access / DLP records
- Proxy, egress and cloud upload events
- Agent / SaaS audit with correlation IDs
Coverage limit. An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.
Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.
Sigma
title: Hunt - Sensitive data → unusual destination
id: 04b60968-3179-4b1f-ae13-6f57c2446077
status: experimental
description: Sensitive reads are followed by outbound transfer, a public
artifact, or a tool call to a destination outside the approved workflow.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
- Authorized activity matching this broad hunt; baseline and investigate
before alerting.
level: low
logsource:
category: application
product: openattacks_audit
definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
Target and CorrelationId from the required source logs first.
detection:
selection:
EventType:
- data.export
- agent.external.send
condition: selection
KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("data.export", "agent.external.send")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated descSPL
sourcetype="openattacks:audit"
EventType IN ("data.export", "agent.external.send")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _timeInvestigation steps
- Join the resource read and outbound action by session, identity or process, preserving a bounded time window.
- Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing.
06Remote code loaderPython startup-hook persistenceNative logs · Draft
sitecustomize.py forks detached process; downloads domain.txt from GitHub repo letters9813/pythonclient-test; if domain resolves, downloads and executes Python from /codepy endpoint; 1-hour loop
What to look for
A package or installer creates sitecustomize.py, usercustomize.py, or a .pth startup hook in a Python environment, causing code to run during later interpreter starts.
Visibility: Endpoint file telemetry where collected
Required logs
- File creation and modification events for Python library directories
- Package-manager and installer process trees
- Subsequent Python process and network activity
Coverage limit. Legitimate packages use .pth files and customization hooks. File telemetry must cover the relevant environment, and the rule does not establish that the hook later executed.
Python startup-hook file candidates. Tune approved packages and environments, then correlate the file event with interpreter execution.
MCP reference matches: Python Site or User Customize File Creation (Elastic detection-rules), Python Site Hooks Creation During Package Installation (Splunk Security Content). The query below is a catalog adaptation, not a verbatim upstream rule.
Sigma
title: Hunt - Python Startup Hook Creation
id: e229b088-94e8-4254-8bfb-fc1e03173def
status: experimental
description: Detects creation of Python customization or path startup hooks.
author: MagicSword OpenAttacks catalog
date: 2026-11-06
references:
- https://github.com/elastic/detection-rules/blob/main/rules/linux/persistence_site_and_user_customize_file_creation.toml
- https://github.com/splunk/security_content/blob/develop/detections/endpoint/python_site_hooks_creation_during_package_installation.yml
falsepositives:
- Legitimate Python package installation and environment management
level: medium
logsource:
category: file_event
detection:
selection_named_hook:
TargetFilename|endswith:
- /sitecustomize.py
- /usercustomize.py
selection_pth:
TargetFilename|contains:
- /site-packages/
- /dist-packages/
TargetFilename|endswith: .pth
condition: 1 of selection_*
KQL
DeviceFileEvents
| where Timestamp > ago(7d)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FileName in~ ("sitecustomize.py", "usercustomize.py")
or (FileName endswith ".pth" and FolderPath has_any ("/site-packages/", "/dist-packages/", "\\site-packages\\"))
| project Timestamp, DeviceName, InitiatingProcessAccountName, FolderPath, FileName,
InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1
| order by Timestamp descSPL
sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
(TargetFilename="*\\sitecustomize.py" OR TargetFilename="*\\usercustomize.py"
OR TargetFilename="*\\site-packages\\*.pth")
| table _time host User Image TargetFilename ProcessGuid
| sort - _timeInvestigation steps
- Inspect the hook contents, owner, package provenance, and creating process.
- Correlate later Python launches with child processes, credential access, or unexpected egress.
Technical detailsTooling, impact & MITRE ATLAS
Attack context
- AI's role
- AI credential theft
- Additional role
- Agent / MCP as target
- Initial access
- Supply chain compromise: malicious wheels published to PyPI and Docker images to GHCR; project release workflow used lookalike source repository (Berri-AI/litellm with hyphen)
Tooling as reported
AI products, models and artifacts
- LiteLLM (legitimate proxy for LLM providers, compromised version)
Other tooling
- Python startup hooks (cook.pth for import cook, sitecustomize.py)
- Base64-encoded zlib-compressed credential collector
- Maturin build with data directory
- RSA-4096 encryption for exfiltration
- GitHub domain.txt pointer for remote code loader
Targets and reported impact
- Targets / sectors
- LiteLLM users across ~23M weekly downloads; affects AI development, cloud deployments, CI/CD pipelines
- Reported scale / exposure
- LiteLLM receives ~23M weekly downloads; 7 platform-specific wheels published Oct 21, 2026 11:39:51 UTC, flagged by Socket AI scanner at 11:46:30 UTC; multiple GHCR/Docker Hub image tags affected
Reported attribution
unknown; lookalike repository and release workflow compromise suggest targeted supply chain operation
Source defensive notes
Block litellm==1.107.0 and affected image digests; Python startup hook monitoring; dependency pinning and artifact verification; registry tag floating risks; separate release credentials from installation environments; audit cloud/AI credentials
MITRE ATLAS
AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.
Supply chain compromise of LiteLLM package specifically targeting AI/ML infrastructure and gateway credentials Source
Credential theft specifically targets AI development tools (Codex, Claude, Gemini, Cursor, Copilot) and LiteLLM proxy database Source
Indicators of compromise
domains
www.litellm.dev
ips
hashes
7598727f209d717041db37f7dca271d3a7d328a279890e0e1d55375729aeb86d0aaf7ba346d41ef2f40390436738b001180d5a1c03aa093f121078a9969d9a1a668169d35b87bf51324080390b1b1c5ab12bd335cfe5f1a99e3689abd5e02ae6462d0c9f67ca522d9e0e4acd245e90b36ce0d5353604a66bb7c43a1ec4a6fcf7c2e32d0ce2548aa662c18bf5001911a79fe5b30cf8357132275add02fdcde0541bbce8caa94f01c0aaa0b7ddae51553a8a32e1ce53d96d44fe583272aff7ad0012d4ccc5c6f8d35cf4f2cf233b7f3e418e863e657d81ff5f5fc9e210005b94849dd0a3926f96a37eb86cf1ee2310d9be93139cc4ebef3ef9e2efe9531390be2534bef04fe88ac9d0aae0475630b1738681d15b94f233ac8aa46eacf5968305fa
urls
http://www.litellm.dev/healthcheckhttps://raw.githubusercontent.com/letters9813/pythonclient-test/main/domain.txt
Sources & research credit
1 sourceResearch by Socket Research Team · Socket
Socket Research Team detected via AI scanner 7 minutes after publication; Upwind provided independent container investigation; Docker provenance recorded malicious source-owner override; loader GitHub pointer returned empty response at 13:01:44 UTC Oct 21
Record & downloads
- Source record name
- LiteLLM 1.107.0 backdoor steals cloud and AI credentials
- Entry ID
- socket-litellm-supply-chain-2026-10
- Catalog review
- November 4, 2026