LiteLLM supply chain attack: what happened, how to check
On 24 March 2026, LiteLLM 1.82.7 and 1.82.8 reached PyPI outside the project CI and carried a credential stealer. What the maintainers reported, how to check a machine, and what to change before installing any LLM gateway.
The LiteLLM supply chain attack happened on 24 March 2026, when two versions of the litellm Python package, 1.82.7 and 1.82.8, were published to PyPI without going through the project’s own release pipeline. Both carried a payload that collected credentials from the machine that installed them and sent them to a domain the attacker controlled. If neither version was ever installed on a machine you own or a CI runner you use, you were not exposed through this incident. If one was, the maintainers’ instruction is to treat every credential on that system as compromised and rotate it. The broader lesson applies to any LLM gateway you install: pin exact versions, check what you download against a published hash, and keep provider keys out of shared environments.
This article sticks to what the LiteLLM maintainers published. It does not judge the current state of LiteLLM.
What happened to LiteLLM on PyPI?
The maintainers tracked the incident in a public GitHub issue, litellm PyPI package (v1.82.7 + v1.82.8) compromised, opened on 24 March 2026. It states that “the attacker published malicious versions to PyPI that were never released through the official GitHub CI/CD”, and that the attacker had gained access to a maintainer’s PyPI account.
The official post on the LiteLLM documentation site, Security Update: Suspected Supply Chain Incident, gives the timeline. The packages were live from 10:39 UTC on 24 March 2026 for about 40 minutes before PyPI quarantined them. The same post defines a wider impact window: you are concerned if you installed or upgraded LiteLLM with pip on that day between 10:39 UTC and 16:00 UTC. It attributes the compromise to the Trivy dependency used in the project’s CI/CD security scanning workflow, and says evidence suggests a maintainer’s PyPI account may have been compromised. Treat the root cause as the maintainers frame it: their best current explanation, still under investigation when they wrote it.
On 30 March, the maintainers announced v1.83.0 as a clean release, built by a new CI/CD pipeline with isolated environments and stronger security gates.
What did the payload collect?
The two versions triggered the payload differently, according to the GitHub issue:
- 1.82.7 carried the payload in
litellm/proxy/proxy_server.py. It ran when code importedlitellm.proxy. - 1.82.8 added a file named
litellm_init.pth(34,628 bytes) on top of the same payload. Python processes.pthfiles insite-packagesat interpreter startup, so this version ran on any Python startup in that environment, with no import of LiteLLM needed.
The official post lists what the payload scanned for: environment variables, SSH keys, cloud provider credentials (AWS, GCP, Azure), Kubernetes tokens, and database passwords. The issue adds crypto wallets, SSL private keys, shell history, and CI/CD configuration. The collected data was encrypted with AES-256-CBC and RSA-4096 and sent by POST to models.litellm.cloud, which the maintainers point out is not an official LiteLLM domain.
For an LLM gateway, the first line of that list is the expensive one. A gateway exists to hold provider API keys, and the usual place to put them is an environment variable. Any OpenAI, Anthropic, or other provider key exported in a shell or a CI job on an affected host was within reach of the payload.
How do you check whether you were affected?
The maintainers’ remediation steps, condensed from the issue and the official post:
- Look for the version. Run
pip show litellmin every environment that has it, including virtual environments, Docker build stages, and CI caches. Versions 1.82.7 and 1.82.8 are the ones named. - Look for the file. Check whether
litellm_init.pthexists in thesite-packages/directory. If it does, remove it and investigate the host for further compromise. - Rotate every credential that was present as an environment variable or in a config file on an affected system: provider API keys, cloud credentials, SSH keys, database passwords, tokens.
- Pin and verify. The issue’s wording is “Pin dependencies to exact versions and verify against GitHub releases.” The official post names v1.82.6 or earlier, or a later verified release, as safe pins.
- Watch for misuse of any credential that may have leaked, such as unexpected usage on a provider dashboard or new cloud resources.
Rotation is the step people skip because it is tedious. It is also the only one that helps after the data has left the machine: deleting the package stops future collection, it does not recall what was already sent.
What LiteLLM got right
Two parts of LiteLLM’s setup limited the damage, and both are worth copying. First, the issue reports that “Proxy Docker image users were not impacted, all dependencies are pinned on requirements.txt”. The official image did not pull whatever PyPI served on the day. Second, the response was public and fast: a tracking issue opened the same day, compromised versions removed, maintainer accounts rotated, and a rebuilt release pipeline before the clean version shipped.
LiteLLM is also a capable gateway in its own right. Its self-hosted proxy gives teams per-user and per-project virtual keys, budgets, and cost tracking, which a local single-user router does not attempt. The comparison of OpenRouter alternatives covers where a self-hosted gateway like LiteLLM fits better than a hosted or local one.
What to change before you install any LLM gateway
This incident hit LiteLLM, but the path it used (a package registry, a stolen publishing credential, a payload that runs at install or import) exists for every gateway, router, and SDK distributed through PyPI or npm. Four habits shrink it.
- Pin exact versions.
litellm==1.83.0in a lockfile, never an open range. A pin means a new upload, malicious or not, reaches you only when you choose to move. - Verify hashes, not just versions. A version number names a release; a hash identifies the exact file. pip’s
--require-hashesmode and lockfiles that record hashes refuse a file whose hash differs from the recorded one, even under the same version. - Install from the release the maintainers built. The issue’s advice to verify against GitHub releases rests on that difference: the malicious versions existed on PyPI and nowhere in the project’s tagged releases.
- Keep provider keys out of shared environments. A CI runner that installs dozens of packages should not hold your production provider keys. Use separate keys per machine and per purpose, so a leak on one host is revoked without touching the others.
How Ficelle’s installer handles this
Ficelle is a local, OpenAI-compatible router that runs on your machine at http://127.0.0.1:8646/v1, where API keys stay local and prompts go directly to the chosen provider. It is installed with one command from the GitHub release, and the script checks the package against a pinned SHA-256.
You can read that check yourself in scripts/bootstrap-ficelle.py at the v0.3.13 tag: the script sets the core version, downloads the core wheel from that version’s GitHub release, computes its SHA-256, and stops with a mismatch error if the result differs from the pinned DEFAULT_CORE_SHA256.
Be precise about what that protects against. A pinned hash refuses a wheel that was swapped or altered after the release was built. It cannot detect a malicious change made before the hash was computed, or a compromise of the repository that publishes both the script and the wheel. No installer makes a project immune to supply chain attacks; the checksum narrows one path, and the four habits above still apply to Ficelle as to any other tool.
Ficelle’s other defaults are about money rather than code: strict-zero routing keeps paid fallback hardcoded off, so routed requests cannot bill you. It also has a known limit on quality: free models trail paid ones on polished long-form writing, so keep that work on a paid model or edit it by hand. Ficelle works with clients such as Claude Code, Continue, Open WebUI, and the OpenAI SDKs; the integrations page lists the setup for each.
If a local router with pinned installs and keys on your own machine fits how you want to run agents, compare Ficelle plans.
Checklist after the LiteLLM PyPI compromise
- Search every environment and CI cache for
litellm1.82.7 or 1.82.8 and forlitellm_init.pth. - Rotate every credential that lived on an affected host, provider keys first.
- Pin LiteLLM, and every other gateway or SDK, to an exact version with a recorded hash.
- Move provider keys off shared CI runners, with one key per machine and purpose.
- Reread the maintainers’ issue and official post for updates rather than relying on secondary write-ups.