# Patch fast, but not too fast: what the LiteLLM backdoor teaches about updates

> In the same week, PHP2Shell said "patch within hours" and a backdoored LiteLLM release punished anyone who updated blindly. How to update fast without pulling in the next supply-chain attack.

Published October 28, 2026 by Antivenom · https://antivenom.ai/blog/patch-fast-not-too-fast

During Black October, security teams got two pieces of advice that sound like they contradict each other.

PHP2Shell said: **patch now**. The NSA told organizations to [patch PHP or take systems offline](https://x.com/cyber_razz/status/2112986024699896176).

LiteLLM said: **careful what you install**. Version 1.107.0 of the popular AI gateway [was compromised in a supply-chain attack](https://x.com/TheHackersNews/status/2112967698103894257). Malicious PyPI packages and Docker images delivered a credential stealer and a backdoor.

Jon Oberheide summed it up in one line: [patch fast for the vulnerabilities, but not too fast for the backdoors](https://x.com/jonoberheide/status/2112908500229578882). Both halves are right. The trick is knowing which update is which.

## Why the LiteLLM compromise hurt

- **Reach.** LiteLLM has about 92 million monthly downloads. A poisoned release spreads through CI pipelines, containers and laptops within hours.
- **Blast radius.** As Arpit Bhayani [pointed out](https://x.com/arpit_bhayani/status/2113116239371637004), the malicious release could steal passwords and keys from a machine even if your code never used LiteLLM. Installing it was enough.
- **What gateways hold.** An AI gateway sits between your apps and model providers, so it usually has the API keys for all of them.

## Two kinds of updates

Treat these differently:

1. **A security fix for a known, published vulnerability.** The risk is in waiting. Ship it in hours, through a path you trust: the official release, checked against its published checksum or signature.
2. **A routine new version of a dependency.** The risk is in rushing. Nothing is on fire, so there's no reason to be the first to install it.

Most automated update setups treat both the same way. That's the gap the LiteLLM attackers used.

## How to update fast without updating blindly

### Pin everything

- Commit lockfiles (`yarn.lock`, `package-lock.json`, `poetry.lock`) and install from them in CI.
- For Python, use hash-checking (`pip install --require-hashes`) so a swapped package fails to install.
- Pin container images by digest, not by a moving tag like `latest`.

### Give new versions a cooldown

- Let routine upgrades wait a few days before they reach production, unless they fix a vulnerability you're exposed to. Malicious releases are often spotted and pulled within days.
- Route installs through an internal registry or proxy, so you can block a bad version for everyone at once.

### Keep secrets away from install and build steps

- Don't give build jobs and developer shells long-lived credentials in environment variables.
- Prefer short-lived, narrowly scoped credentials, so a stolen key is worth less.
- Restrict outbound network access from CI. A build job rarely needs to talk to arbitrary hosts.

### Have a "we installed something bad" plan

When a compromised version is announced:

- Search lockfiles, image manifests and build logs to see exactly where that version landed.
- Rotate every credential those machines and pipelines could reach, not only the ones the package was supposed to use.
- Rebuild affected images and machines from a clean state.

## The bigger point

PHP2Shell punished teams that patched too slowly. LiteLLM punished teams that updated without looking. Both come from the same pressure: attacks are now cheap and fast enough that the gap between "a change ships" and "someone abuses it" keeps shrinking.

You can't win that with a quarterly process. You need to know what's running, change it quickly, and watch what it does after the change. That's the loop we're building Antivenom around. More on that in [why static security rules can't stop AI attackers](https://antivenom.ai/blog/static-rules-vs-ai-attackers).
