{"slug": "litellm-compromised-steals-credentials", "title": "LiteLLM Compromised, Steals Credentials", "summary": "A malicious version 1.107.0 of the LiteLLM package was uploaded to PyPI and Docker on October 21, 2025, carrying a credential stealer targeting browser, cloud and AI secrets plus a dormant command-and-control capability, and received approximately 49,000 downloads before PyPI quarantined it at 13:20 UTC. The trojanized build also shipped in LiteLLM Docker containers on GHCR and Docker Hub under the v1.107.0, latest, main-latest and main-stable tags, which were removed around 13:53 UTC; the most recent safe version is v1.106.2. LiteLLM said the attacker compromised its release workflow through three engineers' GitHub accounts using stolen GitHub CLI OAuth tokens, after gaining access to an internal LiteLLM deployment exposed to the public internet, and that all tokens involved in the attack have been revoked.", "body_md": "In a new incident, a malicious version (1.107.0) of the LiteLLM package was uploaded to PyPI and Docker on October 21. The malicious version includes a credential stealer targeting browser, cloud and AI secrets as well as a dormant C2 capability.\n\nAt 11:39 UTC on October 21, a malicious version (1.107.0) of the LiteLLM package was uploaded to PyPI. This version was quarantined on PyPI as of 13:20 UTC. According to ClickPy data, the malicious version received approximately 49,000 downloads.\n\nLiteLLM Docker containers on GHCR and Docker hub also included the trojanized version of LiteLLM. These included the v1.107.0 , latest, main-latest and main-stable tags. These were removed ~13:53 UTC.\n\nThe most recent safe version is v1.106.2.\n\nWhen the malicious package is installed, three files are extracted directly into the site-packages root: cook.pth, cook.py and sitecustomize.py. These packages are designed to be executed whenever a python interpreter is started.\n\nmalicious actions were taken through three engineers' GitHub accounts, appearing to be by way of stolen GitHub CLI OAuth tokens. The threat actor used one user's account triggered the project-releaser run, and another user's account to approve it. All tokens which were involved in this attack have been revoked.\n\nGitHub CLI OAuth token exposure\nAfter a thorough investigation, we have observed specific situations in which Claude Code will embed a user’s GitHub CLI OAuth token into a response body, and in situations where response bodies are logged, these tokens may appear in LiteLLM logs.\nAccess to our internal LiteLLM deployment\nWe identified an unexpected, innocuously named user account in our internal LiteLLM deployment, which was exposed to the public internet. We believe the attacker gained access to this deployment, obtained the GitHub CLI OAuth tokens from its logs, and subsequently used those credentials to compromise our release workflow.\nWe have not yet confirmed how the attacker gained access to our internal deployment, but currently suspect it was through a recently patched vulnerability.\n\nUPDATES\n\n14:05 UTC - added IOC table\n\n14:15 UTC - added Attack Commits details\n\n14:40 UTC - added Credential Stealer details, noted Docker takedown\n\n15:20 UTC - clarified dual-technique approach novelty and LLM-aided development\n\n19:05 UTC - added observed post-exploitation activity\n\n21:45 UTC - updated LiteLLM details on root cause\n\nOctober 22 12:55 UTC - added PyPi download stats\n\nPayload\n\nThe payload has strong indications of LLM-aided development, including verbose variable names (encrypted_private_key_output), overly defensive error handling with generic try/except blocks, platform-specific code paths that fail silently on untested platforms (Windows marker path /tmp/ doesn't exist, fcntl/fork calls crash the remote loader), and a dead code module (exec_py) that was defined but never called. The structure suggests iterative prompting: functional on the happy path but brittle at the edges and untested.\n\nUpon startup, the interpreter processes cook.pth, which includes a command to import cook, which loads cook.py. cook.py deobfuscates itself, runs a stealer routine and writes a maker to /tmp/.pc_once_72129118c59f5636c0bb (note this fails on Windows, as the /tmp/ path often does not exist). The stealer routine gathers system, browser, developer, cloud and AI tool secrets, encrypts them and exfiltrates to www.litellm.dev/healthcheck via a post request. This domain is attacker controlled, impersonating LiteLLM infrastructure.\n\nPython interpreters will also attempt to execute sitecustomize.py - however, it will only run on Linux & MacOS machines. This script attempts to fetch domain.txt from a GitHub dead drop (letters9813/pythonclient-test/main/domain.txt). If it receives a response, it will attempt to download a second stage python script from http://<domain>/codepy and run it. As of the time of analysis, the domain.txt file was never populated beyond initial test values. The repo has been taken down by GitHub as of 1:30 PM UTC.\n\nThe dual-technique approach, using both .pth files and sitecustomize.py simultaneously, appears to be the first documented case in the wild.\n\nCredential Stealer\n\nThe embedded credential stealer, internally named privcollect, harvests sensitive data across 16 modules targeting browsers, cloud providers, and AI services. It extracts:\n\nbrowser credentials and cookies from Chrome, Firefox, Edge, and Safari\n\nAWS credentials from ~/.aws/, environment variables, and EC2/ECS instance metadata (IMDS)\n\nGCP service account keys and application default credentials\n\nAzure tokens from the CLI cache\n\nIn terms of AI-specific theft, it targets API keys for OpenAI, Anthropic, Cohere, and other LLM providers stored in environment variables or config files. It also collects SSH private keys, GPG keys, and shell history files.\n\nLiteLLM Proxy stores upstream API keys in a PostgreSQL database. The stealer queries this database directly (SELECT * FROM \"LiteLLM_CredentialsTable\" LIMIT 500) to extract all configured provider credentials.\n\nHarvested data is encrypted with AES-256-CBC (key wrapped with RSA-4096) and exfiltrated over HTTP to www.litellm[.]dev/healthcheck using the hardcoded X-Token header and an Internet Explorer 7 user-agent string.\n\nAttacker Commits\n\nThe payload originates with malicious commits made on github.com/Berri-AI/litellm. Note, this is a hyphenated variant of the legitimate BerriAI organization. This repository, not visible on GitHub, was used to inject the payload into the release pipeline.\n\nBetween 08:56 and 10:46 UTC on October 21, the attacker pushed 10 commits using the author email ckdi82fkoos@proton.me. The first nine commits were created on GitHub.com and therefore signed with GitHub's verified signature.\n\nThe first three (within 2 minutes) added the persistence files: cook.pth, cook.py, and sitecustomize.py. Four more commits bumped version numbers to 1.107.0.\n\nAfter a 39-minute gap, two commits refined the payload and added the critical data = \"cook\" directive to pyproject.toml, which instructed the build tool to bundle the malware into the wheel.\n\nA final commit, made 58 minutes later with a different email (Berri-AI@users.noreply.github.com) and unsigned (suggesting a different environment), added COPY cook ./cook to the Dockerfiles.\n\nAlthough the Berri-AI repository is unavailable, all commits remain accessible through the parent repository due to Git's fork object sharing. The full diff is available at: github.com/BerriAI/litellm/compare/a8113b0d...20535d8f\n\nPost-Exploitation Activity\n\nWiz Research has observed abuse of stolen credentials, starting approximately 4.5 hours post-exfiltration. Between 16:20 and 17:01 UTC, the attacker validated AWS instance role credentials harvested from compromised CI runners and Kubernetes nodes across multiple environments, from the following IP addresses:\n\n168.100.8[.]57\n\n165.227.201[.]8\n\nEach credential was checked with sts:GetCallerIdentity, followed by bedrock:ListFoundationModels and a ListModels call, consistent with LLMjacking.\n\nIn a small number of environments, the attacker also enumerated IAM (ListRoles, ListUsers, ListAccessKeys) and performed general discovery (ListAccounts, DescribeTrails, etc.).\n\nEnable native runtime protection for GKE in just one click. The Wiz Runtime Sensor add-on now automates deployment and credential management while delivering predictable, kernel-level eBPF threat detection for your GKE Kubernetes fleets.\n\nHow a single Google Search ad click leads to credential theft, hijacking of cloud billing account, and hundreds of thousands of dollars incurred in unauthorized AI API usage\n\nWhen trusted packages are compromised, malicious code can quickly spread throughout and beyond developer environments. See how Wiz’s supply chain pipeline identifies compromised packages at publication, helping teams detect zero-day supply chain compromises in Wiz Defend before a CVE is published\n\nGet a personalized demo\n\nReady to see Wiz in action?\n\n\"Best User Experience I have ever seen, provides full visibility to cloud workloads.\"\n\nDavid EstlickCISO\n\n\"Wiz provides a single pane of glass to see what is going on in our cloud environments.\"\n\nAdam FletcherChief Security Officer\n\n\"We know that if Wiz identifies something as critical, it actually is.\"\n\nGreg PoniatowskiHead of Threat and Vulnerability Management", "url": "https://wpnews.pro/news/litellm-compromised-steals-credentials", "canonical_source": "https://www.wiz.io/blog/litellm-compromised-steals-credentials", "published_at": "2026-10-21 13:44:12+00:00", "updated_at": "2026-11-04 14:29:01.176499+00:00", "lang": "en", "topics": ["ai-safety", "ai-infrastructure", "ai-tools", "developer-tools"], "entities": ["LiteLLM", "PyPI", "Docker Hub", "GHCR", "GitHub", "Claude Code", "ClickPy"], "also_reported_by": [], "takeaway": "LiteLLM 1.107.0 dropped cook.pth, cook.py and sitecustomize.py into site-packages to run on every Python interpreter start, exfiltrating browser, cloud and AI secrets to the attacker-controlled www.litellm.dev/healthcheck, so anyone who installed it should revert to v1.106.2 and rotate credentials.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/litellm-compromised-steals-credentials", "markdown": "https://wpnews.pro/news/litellm-compromised-steals-credentials.md", "text": "https://wpnews.pro/news/litellm-compromised-steals-credentials.txt", "jsonld": "https://wpnews.pro/news/litellm-compromised-steals-credentials.jsonld"}}