Ackatec
All insights

The LiteLLM 1.107.0 Supply Chain Attack: How to Secure AI Gateways and the Keys They Hold

A poisoned LiteLLM release targeted cloud and AI provider keys on October 21, 2026. What happened, who is exposed, and how to secure your AI gateway.

Author
Ackatec
Published
Reading time
7 min read
  • AI security
  • Software supply chain
  • AI gateway
  • Secrets management
  • Incident readiness
  • AI governance

On October 21, 2026, a malicious build of LiteLLM, a popular open source library and proxy that puts more than 100 AI model providers behind one OpenAI compatible API, was published to PyPI and to the project's official container images. It carried a credential stealer aimed at exactly what an AI gateway holds: model provider API keys, cloud credentials, and developer tokens.

If your teams build with large language models or use AI coding tools, this incident matters even if you never installed the bad version. The root cause was not an exotic AI flaw. It was a leaked key that was never revoked and an unscoped token sitting in an internal agent tool.

What happened in the LiteLLM 1.107.0 compromise?

The LiteLLM 1.107.0 compromise was a software supply chain attack in which an attacker used stolen GitHub credentials to make LiteLLM's own release pipeline build, sign, and publish a poisoned version. According to LiteLLM's incident post (opens in a new tab), the malicious package was live on PyPI from 11:39 to 13:23 UTC, and the Docker image tags v1.107.0, latest, main-latest, and main-stable pointed to compromised images from 11:46 until as late as 14:20 UTC. Wiz (opens in a new tab) reports roughly 49,000 PyPI downloads of the malicious version.

What made it dangerous is how the code ran. Microsoft's analysis (opens in a new tab) explains that the package dropped files Python executes at interpreter startup, so an application did not need to import LiteLLM at all. Starting Python in an affected environment could be enough, including running pip on a developer laptop or a CI runner.

Why is an AI gateway such a valuable target?

An AI gateway is a service that sits between your applications and model providers, routing requests and holding the credentials to call them. That makes it a concentration point for secrets. Microsoft notes a gateway like LiteLLM may have access to provider API keys, database connection strings, workload identities, and tenant policy data.

The stealer was built for that environment. Microsoft found it targeted browser data, SSH keys, cloud credentials, and process environments, and it attempted to read stored provider credentials from the LiteLLM proxy database. StepSecurity (opens in a new tab) lists configuration files for more than 20 AI coding tools among its targets.

Stolen credentials were used quickly. Wiz observed the attacker validating harvested AWS instance role credentials about 4.5 hours after exfiltration, then calling Amazon Bedrock model listing APIs, a pattern consistent with LLMjacking, which StepSecurity describes as the abuse or resale of stolen access to paid LLM services.

How did the attacker get into the release pipeline?

LiteLLM's attack chain report (opens in a new tab), published October 23, is the canonical account. Its first explanation, that tokens leaked through internal request logs, turned out to be wrong, which is a useful reminder that early incident narratives often change. The confirmed chain:

  1. May 27: a configuration file committed to a public repository contained an administrative key for an internal agent platform. The file was deleted about three hours later, but the key was never revoked.
  2. October 10: the attacker used that key to call the agent platform's API, which returned the GitHub CLI OAuth token of one of the organization's two GitHub owners. That token was not scoped to specific repositories.
  3. October 10: with owner access, the attacker pushed throwaway branches whose workflows sent CI secrets to an outside endpoint, collecting tokens for two more maintainers, then deleted the runs. A second round on October 12 took more secrets from private repositories.
  4. October 21: the owner token overrode branch protection to change the release workflow so it built from a lookalike repository, Berri-AI/litellm. A second stolen token approved the production gate, which had been temporarily relaxed earlier that week so any two engineers could release. A third token deleted the workflow run records.

StepSecurity points out that LiteLLM had hardened its pipeline after a separate PyPI compromise in March, with Trusted Publishing, immutable tags, and image signing. None of it stopped this attack, because the attacker changed the trusted workflow itself. Signed does not mean safe when the signer is compromised.

Were you affected?

You are likely affected if any system installed litellm==1.107.0, or pulled or restarted one of the affected image tags during the exposure window on October 21. LiteLLM says users of its private enterprise registry were not affected. Projects that depend on LiteLLM with an open ended constraint such as litellm>=, or that track a floating image tag like latest, were at particular risk, because a routine install, lock refresh, or image pull during the window could resolve to the malicious version.

Check lock files, package mirrors, CI caches, image digests, and developer machines, not only production gateways. Finding the malicious files confirms exposure, but LiteLLM cautions that not finding them does not prove an environment is clean.

What should you do if you ran the malicious version?

Treat the host as compromised. The core steps from LiteLLM and Microsoft:

  • Do not start Python or pip in the suspect environment. Investigate with trusted tools from a known clean system.
  • Kill the background loader and remove the startup files, then rebuild environments and images from scratch rather than repairing them in place.
  • Assume exfiltration succeeded on any host with outbound internet access.
  • Rotate everything the host could reach, from a clean machine: cloud roles and keys, every provider key stored in the proxy database, LiteLLM master and virtual keys, the database password, CI and registry tokens, and AI coding tool tokens.
  • Hunt in cloud logs for use of those credentials from outside your infrastructure.

Rotation is only fast if someone already knows where every AI provider key lives. A rehearsed incident readiness plan names that owner and the order of operations before you need them.

How should you secure AI gateways going forward?

Securing an AI gateway means treating it as a high value secrets store: pin exactly what you run, limit where it can connect, and minimize the credentials it and the tools around it can reach.

Pin dependencies and images by hash

Microsoft recommends hash pinned lock files, verifying package provenance, using container digests instead of floating tags, and admitting packages to internal mirrors only after review. The OWASP Top 10 for LLM Applications (opens in a new tab) lists supply chain risk as LLM03 and recommends a current software bill of materials and applying component controls to development environments that touch sensitive data.

Restrict outbound traffic from gateways and build systems

Gateway hosts, CI runners, and developer environments rarely need unrestricted outbound HTTP. Microsoft advises routing egress through managed controls with an allowlist. StepSecurity notes that an egress block on the CI runners could have stopped the October 10 uploads of secrets to an outside endpoint, eleven days before the malicious release.

Scope and expire the credentials your AI tools hold

The pivotal credential in this attack was an organization owner's unscoped token stored in an internal agent platform. Give agents and automation their own narrowly scoped identities, keep owner level tokens off automated systems, and treat any key that touches a public repository as burned until it is revoked. An AI governance readiness review can turn this into an owned inventory of which AI tools hold which credentials and who approves exceptions.

Protect the release path, not just the code

Alert on branch protection overrides, deleted workflow runs, and unexpected workflow changes. LiteLLM's audit log recorded each override. Put an expiry on any temporary relaxation of release approvals. For a broader look at the attack surface of AI agents and tools, see testing AI agents before launch.

Questions to answer this week

  1. Where do we run LiteLLM or any other AI gateway, and who owns each one?
  2. Do our lock files and deployments pin versions by hash and digest, or float?
  3. Which provider API keys does each gateway hold, and how fast could we rotate them all?
  4. Can our gateways and CI runners reach any destination on the internet?
  5. Do any automated or agent systems hold unscoped or owner level tokens?
  6. Would we notice a branch protection override or a deleted workflow run?

If several answers are unclear, a focused security assessment can map the exposure and sequence the fixes. Acting on findings reduces risk but does not guarantee that no incident will occur. Talk with Ackatec about where to start.

References