SysArt
Book a briefing
SysArt

AI security

LiteLLM: What It Is, the 2026 Supply Chain Attacks and How to Secure It

LiteLLM explained: what the open-source AI gateway does, what happened when versions 1.82.7, 1.82.8 and 1.107.0 were compromised, its CVEs and how to harden it.

Last reviewed by SysArt AI Architecture Team9 min readHow we review

In short

LiteLLM is an open-source Python SDK and self-hosted proxy from BerriAI that puts one OpenAI-format API in front of more than 100 model providers and local models. Because the proxy holds every provider key, it is a high-value target: attackers published malicious releases in March and October 2026. Pin versions, verify artefacts and isolate the gateway.

Key takeaways

  • LiteLLM is a Python SDK and a self-hosted AI gateway (the proxy) from BerriAI. The code outside its enterprise directory is MIT-licensed; an enterprise licence key enables SSO, audit logs and other features on the same image.
  • Attackers published credential-stealing releases twice in 2026: versions 1.82.7 and 1.82.8 on PyPI on 24 March, and version 1.107.0 on PyPI, Docker Hub and GHCR on 21 October. Version 1.106.2 is the last release before the October incident.
  • The compromised 1.107.0 images carried a valid signature, which shows that signing proves where an artefact was built, not that it is safe.
  • As of 23 November 2026, the project had published 20 security advisories, five rated critical. NVD shows two LiteLLM CVEs in CISA's Known Exploited Vulnerabilities catalogue.
  • Treat the gateway as tier-zero infrastructure: pin and verify releases through a private mirror, keep keys in a vault, isolate the network, protect the admin UI, minimise prompt logging and patch quickly.
A brass padlock fastened to a grey metal chain

What is LiteLLM?

LiteLLM is an open-source project from BerriAI that lets software call more than 100 large language model (LLM) providers through one interface. It comes in two parts: a Python SDK and a self-hosted proxy server that the documentation also calls an AI gateway or LLM gateway.

  • The Python SDK gives developers one completion() call, plus embeddings, image generation and a Router that retries, falls back and balances load across deployments. Responses follow the OpenAI Chat Completions format whichever provider answers.
  • The proxy is a server you run yourself. Any client that speaks the OpenAI API can use it without code changes, and it also serves the Anthropic Messages API for tools such as Claude Code.

Licence. The repository’s licence file applies the MIT licence to everything outside the litellm/enterprise/ directory, which carries its own licence. LiteLLM Enterprise is a licence key, set in LITELLM_LICENSE, on the same gateway image. It adds SSO and SCIM, audit logs with retention, team admin roles, secret manager integrations, IP allowlists and support SLAs. Pricing is quoted by sales.

As of 23 November 2026, the latest stable release on PyPI is 1.110.2, published on 20 November. The project also publishes a 1.108.x line marked LTS (long-term support) on GitHub.

What does the LiteLLM proxy do?

The proxy puts one controlled API in front of hosted and local models. Applications get one endpoint and one kind of key; the platform team keeps the real provider credentials and the policy in one place.

  • Virtual keys. The proxy issues its own API keys. Each key can carry a model list, a spend budget with a reset period, rate limits and an expiry. Keys need a Postgres database and a master key, the proxy admin credential, which must start with sk-.
  • Routing. Load balancing across deployments with automatic fallbacks.
  • Cost tracking. Spend per key, user and team across providers.
  • Guardrails, logging and caching. Content filtering, PII masking, callbacks to observability tools and an admin UI.
  • Agents and MCP. The gateway can also front agent-to-agent (A2A) traffic and Model Context Protocol (MCP) tools.

LiteLLM with Ollama. The proxy reaches a local Ollama server with the ollama_chat/ model prefix and an api_base such as http://localhost:11434. That lets teams mix local models with hosted ones behind the same keys.

LiteLLM with Claude Code. Claude Code connects when ANTHROPIC_BASE_URL points at the proxy and ANTHROPIC_AUTH_TOKEN holds a LiteLLM virtual key. The documentation tells users to unset ANTHROPIC_API_KEY so the client does not send a provider key instead. Our guide to Claude Code with local models covers the same pattern without a gateway.

For the general design of a gateway layer, identity, quotas and audit, see building an enterprise AI gateway on-premises. This article focuses on LiteLLM’s own security record.

Why is an AI gateway a high-value target?

A gateway holds the keys to every model account an organisation pays for, and it sees every prompt. Compromising it gives an attacker spend, data and a foothold in one step.

In a typical LiteLLM deployment the proxy database stores provider API keys, encrypted with LITELLM_SALT_KEY. The process environment holds the master key, the database password and often cloud credentials. Logs and traces may hold prompts and responses, which can contain personal data. And many applications, agents and coding tools trust the gateway’s answers.

LiteLLM’s own record shows each of these exposures. In March 2026 the project disclosed that guardrail logging could write plaintext Authorization headers into spend logs and OpenTelemetry traces; it was fixed in 1.82.3. Its October incident notice tells affected users to rotate every provider key stored in the proxy database. The same reasoning applies to any gateway.

What happened in the LiteLLM supply chain attack in March 2026?

On 24 March 2026, an attacker uploaded two malicious LiteLLM versions, 1.82.7 and 1.82.8, straight to PyPI. They stole credentials from any machine that installed them.

Timeline. According to LiteLLM, the two versions went live on PyPI from 10:39 UTC and stayed available for about 40 minutes before PyPI quarantined them. LiteLLM treats unpinned installs up to 16:00 UTC that day as potentially affected. Neither version came through the project’s GitHub release process.

Root cause. LiteLLM’s townhall update gives its understanding at the time: a compromised Trivy security scanner, pulled in as an unpinned dependency, ran in the CI/CD pipeline. The pipeline shared one environment across steps and held long-lived PyPI, GHCR and Docker publishing credentials as environment variables, so the scanner could read them.

What the code did. Version 1.82.7 hid its payload in proxy_server.py, which ran when the proxy module was imported. Version 1.82.8 added a litellm_init.pth file; Python processes .pth files at interpreter start, so the payload ran on any Python start. It collected environment variables, SSH keys, cloud and Kubernetes credentials and database passwords, encrypted them and sent them to models.litellm.cloud, a domain LiteLLM says it does not own.

Who was not affected. LiteLLM says users of the official proxy Docker image were not affected, because that image pins its dependencies, and neither were LiteLLM Cloud users or anyone who stayed on 1.82.6 or earlier. Unpinned pip install litellm runs, including Docker builds and transitive installs, were exposed during the window. The project rotated its credentials, engaged Mandiant, paused releases and shipped a clean 1.83.0 through a rebuilt pipeline on 30 March.

What was the LiteLLM 1.107.0 compromise?

Version 1.107.0, published on 21 October 2026, was a second malicious release. This time attackers used the official release pipeline, so the bad artefacts reached PyPI, Docker Hub and GHCR.

LiteLLM’s attack-chain post explains the path:

  1. On 27 May 2026, an administrative key for an internal LiteLLM agent platform was committed to a public repository. It was removed from the file hours later but stayed in Git history, and it was never revoked.
  2. On 10 October, the attacker used that key to obtain a GitHub CLI token belonging to an organisation owner, then exfiltrated other maintainers’ tokens through throwaway workflows.
  3. On 21 October, the attacker overrode branch protection, changed the release workflow to build from a look-alike repository (Berri-AI/litellm) and approved the production gate with a stolen token. Seven wheels reached PyPI at 11:40 UTC and Docker images at 11:46 UTC.
  4. A security researcher reported the release on GitHub at 12:06 UTC. PyPI quarantined it at 13:23 UTC and the Docker tags, including latest, were cleaned by 14:20 UTC.

The malware stole credentials and loaded remote-code tools. It ran on every Python start through cook.pth and sitecustomize.py and could leave a background daemon holding /tmp/remote_code_loader.lock. LiteLLM names 1.106.2 as the last safe version. It says customers pulling from its private enterprise registry were not affected.

The lesson for buyers is in LiteLLM’s follow-up: the malicious images carried a valid signature from the project’s key, because Trusted Publishing and signing proved only that the artefacts came from the pipeline. LiteLLM has since restricted owner accounts and is adding an external verifier that compares published artefacts with the source tag. It lists target dates running into January 2027.

Which LiteLLM CVEs and vulnerabilities matter?

As of 23 November 2026, the GitHub repository lists 20 published security advisories: five critical, seven high, six medium and two low. Most affect the proxy, and several allow access without valid credentials.

IdentifierIssueAffectedFixed in
CVE-2026-42208 (critical)SQL injection in proxy API key checks, reachable without authentication1.81.16 to before 1.83.71.83.7
CVE-2026-42271 (high)Authenticated command execution through MCP stdio test endpoints1.74.2 to before 1.83.71.83.7
CVE-2026-49468 (critical)Host-header flaw allowing unauthenticated access to management routesBefore 1.84.01.84.0
GHSA-w4c7-34wj-hqm8 (critical)Unauthenticated file read leaking the master key on the Enterprise proxyLines before 1.103.10, 1.104.8, 1.105.6, 1.106.5Those versions

The NVD records for CVE-2026-42208 and CVE-2026-42271 show both in CISA’s Known Exploited Vulnerabilities catalogue, which means exploitation was observed in the wild. Other advisories cover server-side request forgery (SSRF), privilege escalation through reuse of the salt key, authentication bypasses and a reflected cross-site scripting flaw. The newest, published on 20 November 2026, lets keys without an owner read metadata of other such keys.

LiteLLM runs a HackerOne disclosure programme and a paid Private Registry that gives enterprise customers fixes for severe flaws before public release. Track the advisories page, not only release notes.

How do you check whether you were affected?

Search every environment, image and lock file for the three malicious versions, then treat any host that ran one as compromised.

  • Find installs. Run pip show litellm in each environment and search lock files, CI logs and image histories for 1.82.7, 1.82.8 and 1.107.0, including indirect installs through other packages.
  • Look for indicators. For March, litellm_init.pth in site-packages and traffic to models.litellm.cloud. For October, cook.pth, cook.py, sitecustomize.py, the lock file above and the image digest LiteLLM publishes.
  • Rebuild, do not upgrade. LiteLLM warns that running pip on an affected host starts Python and re-runs the payload.
  • Rotate everything reachable. Provider keys in the proxy database, master and virtual keys, the database password, cloud roles, SSH keys and any secret in the environment.
  • Check cloud audit logs for use of those credentials from outside your infrastructure.

If personal data may have been exposed, involve your data protection officer early; breach notification duties depend on the facts, and this article is not legal advice.

How do you harden a LiteLLM deployment?

Treat the gateway as tier-zero infrastructure, like an identity provider. Combine LiteLLM’s production guidance with general supply chain controls.

Supply chain

  • Pin exact versions, install with hashes (pip install --require-hashes) and deploy images by immutable digest, never latest.
  • Pull through a private package mirror and registry with a short cooldown before new versions are admitted.
  • Verify signatures and PyPI attestations, but also compare artefacts with the source tag; a valid signature did not stop 1.107.0.
  • Keep a software bill of materials (SBOM) for each image. Our article on supply chain security for on-premises AI models covers the model side.

Secrets and access

  • Keep LITELLM_MASTER_KEY, LITELLM_SALT_KEY and DATABASE_URL in a secret manager, rotate the master key and never change the salt key after models are added.
  • Set LITELLM_MODE="PRODUCTION" so the proxy does not load a local .env file.
  • Give users and agents scoped virtual keys with budgets and expiry; never hand out the master key, which is also the admin UI password.

Network and runtime

  • Run the proxy on a private network behind your identity-aware proxy. Do not expose the admin UI or management routes to the internet, and set trusted_proxy_ranges.
  • Restrict outbound traffic to the providers you use. Both malicious releases sent stolen data out over the internet, and LiteLLM tells users of 1.107.0 on hosts with outbound access to assume exfiltration succeeded.
  • Run as non-root with a read-only root filesystem, and verify the database certificate with sslmode=verify-full.

Logging and GDPR

  • Keep message logging off unless you have a defined purpose for storing prompts, use callback redaction where you do, set retention on every log store and check backups and traces. The Commission’s GDPR guidance asks organisations to process only the data needed and keep it as short a time as possible; our guide to GDPR-compliant LLM deployment goes further.

Upgrades

  • Patch critical advisories promptly, follow a supported or LTS line and restrict MCP and custom-code features, which several advisories involved. See AI agent security for agent traffic through the gateway.

LiteLLM vs OpenRouter: which fits an enterprise?

They solve different problems. LiteLLM is software you run, so keys, prompts and logs stay in your environment and your team owns patching. OpenRouter is a hosted service that routes requests to many model providers through one API and account, so the provider runs the service and you rely on its data handling. Our OpenRouter enterprise review covers that side.

How SysArt helps

SysArt designs and secures model gateways for regulated organisations, whether built on LiteLLM or another option, as part of a private LLM platform. We review the release path, secrets, network placement, logging and incident runbooks, and deliver the controls and evidence your security and data protection teams need. Learn more about our AI security services.

Featured image by Roth Melinda on Unsplash.

Frequently asked questions

What is LiteLLM used for?

LiteLLM lets applications call many model providers through one interface. The Python SDK gives developers a single completion function for more than 100 providers. The proxy, which BerriAI also calls an AI gateway, is a self-hosted server that exposes an OpenAI-compatible API and adds virtual keys, budgets, rate limits, routing with fallbacks, logging, guardrails and an admin UI in front of hosted and local models.

Is LiteLLM safe to use?

LiteLLM can be run safely, but not with default habits such as unpinned pip installs or the latest Docker tag. Its releases were compromised twice in 2026, and its advisories list several critical proxy flaws, all fixed in later versions. Pin and verify each release, mirror packages internally, keep provider keys in a vault, put the proxy on a private network and follow its production checklist.

Which LiteLLM versions were compromised?

Three versions were malicious. On 24 March 2026, versions 1.82.7 and 1.82.8 were uploaded to PyPI with a credential stealer. On 21 October 2026, version 1.107.0 was published to PyPI and as Docker images on Docker Hub and GHCR. All three are removed from PyPI. LiteLLM names 1.106.2 as the last safe version before the October release.

What was LiteLLM 1.107.0?

Version 1.107.0 was a malicious LiteLLM release published on 21 October 2026. Attackers who had stolen maintainers' GitHub tokens built it from a look-alike repository through the official release pipeline. The wheels and images contained malware that stole credentials and loaded remote-code tools on every Python start. PyPI quarantined it about 1 hour 43 minutes after publication.

What should I do if I installed a compromised LiteLLM version?

Assume every secret the host could reach is exposed. Rebuild the environment from scratch rather than upgrading in place, remove the malicious startup files LiteLLM lists, and rotate provider keys, the master and virtual keys, the database password, cloud roles and any other environment secrets. Then check cloud audit logs for credential use from outside your infrastructure, following LiteLLM's incident posts.

Can LiteLLM work with Ollama and Claude Code?

Yes. The proxy routes to Ollama with the ollama_chat/ model prefix and an api_base such as http://localhost:11434. Claude Code connects by setting ANTHROPIC_BASE_URL to the proxy and ANTHROPIC_AUTH_TOKEN to a LiteLLM virtual key. Use a virtual key limited to the models a team needs, never the master key, so access and spend stay controlled.

Is LiteLLM free and open source?

Mostly. The repository's licence file applies the MIT licence to everything outside the litellm/enterprise directory, which has its own licence. Enterprise features such as SSO beyond five users, SCIM, audit logs with retention, IP allowlists and support SLAs need a paid licence key applied to the same gateway image. Pricing is quoted by sales.

Related insights

Plan your private AI with people who build it

Book a briefing. We look at your use case, data and constraints, and you leave with the deployment options and governance steps that fit.