Monday, 16 November 2026

Is LiteLLM safe? Two hacks, one key hunt and the fixes that matter

LiteLLM itself is usable, but exposed gateways, default master keys and a poisoned October release have made it a magnet for attackers chasing AI provider keys.

Server racks with blue lights and a laptop on a cart in a dim data center aisle

The short version

  • Amazon's decoy servers caught attacker AI agents hunting exposed LiteLLM, Dify and similar apps for stored AI provider keys.
  • The agents' playbook leaned on basic mistakes such as LiteLLM's default master key and half-finished installs open to the internet.
  • Separately, LiteLLM's release pipeline was hijacked on October 21 and pushed a credential-stealing version 1.107.0 to PyPI and Docker.
  • LiteLLM is safe to keep using if you run a clean version, change default keys, keep the admin side off the internet and rotate exposed secrets.
Quick read · 2 min

Is LiteLLM safe? It can be, but only with care. Amazon's threat team says attacker-run AI agents spent weeks scanning the internet for exposed LiteLLM, Dify and similar AI tools, aiming to pull out stored provider keys and use them to fund more searching. Their favorite way in was simple: default master keys, half-finished installs and admin pages with no login.

LiteLLM also had its own release pipeline hijacked on October 21. Version 1.107.0 on PyPI and Docker carried malware that stole cloud, developer and AI tool credentials, running every time Python started. It was pulled within hours, and 1.106.2 is named as the last clean release.

  • If you installed 1.107.0, rebuild the system and rotate every secret it could reach.
  • Change the default master key and keep the admin side off the public internet.
  • Pin exact versions and watch AI spending for spikes.

Is LiteLLM safe? The short answer: the software can be run safely, but the way many people deploy it is not, and attackers have noticed. Amazon’s threat intelligence team says it caught AI agents run by attackers combing the internet for exposed LiteLLM, Dify and similar AI apps so they could pull out the provider keys stored inside and use them to pay for even more hunting.

That matters if you or your company use LiteLLM, the popular open-source gateway that lets one app talk to models from many AI providers through a single interface. One weak gateway can hold keys for several paid accounts at once. Add a separate October incident, when LiteLLM’s own release pipeline was hijacked to ship malware, and the honest answer is this: LiteLLM is safe enough to keep using only if you run a clean version, change the defaults and keep its admin side away from the open internet.

01

Is LiteLLM safe after the AI agent key hunt?

LiteLLM was not hacked in this campaign; badly configured copies of it were the target. Amazon’s MadPot network of decoy sensors pretended to be popular large language model services. From early October to early November, attacker agents sent it requests that often carried the full memory of their campaigns, including the operators’ instructions and what the agents claimed to have found.

Those records describe a loop that funds itself. The agents found internet-facing AI apps, pulled out the upstream keys for providers, checked that the keys still worked and dropped them into a shared pool. The stolen keys then paid for the model calls that powered the next round of searching.

The target list reads like a who’s who of self-hosted AI tools. Gateways and proxies such as LiteLLM, Sub2API, One API, Veloera and New API sat alongside app builders including Ollama, Open WebUI, Dify, LobeChat, FastGPT, Langflow and RAGFlow. The agents preferred tools that collect keys for many providers, because breaking one admin page can open many accounts.

Two caveats are important. Amazon says it did not watch these break-ins happen and cannot confirm the results the agents reported. Its analysts believe, though not with certainty, that several distinct groups tied to China were behind it, using ARTEX, an open-source AI penetration testing framework. Amazon has notified AWS customers who may have been affected.

A ring of small brass keys resting on a dark computer keyboard
02

The mistakes the attackers were counting on

None of the tricks were new. Amazon’s point is that AI agents make attackers faster and more persistent, and that they won where basic hygiene was missing. The playbook in the captured records focused on a handful of everyday errors:

  • Default credentials. LiteLLM’s default master key was named directly as an entry point.
  • Unfinished setups. Installs left half-configured on a public address, where a stranger could finish the setup and take control.
  • Admin pages with no login. Management and provider settings endpoints reachable without signing in.
  • Leaky front ends. Secrets left in browser-side JavaScript, source maps, debug routes and environment files.
  • Cloud metadata tricks. Abusing URL-fetch features (a flaw class called server-side request forgery) to reach a cloud server’s internal credential service.

To find keys that had leaked elsewhere, the agents searched GitHub, package archives on npm and PyPI, container image layers, notebooks, paste sites and Telegram channels, plus internet scanners and certificate transparency logs. When they found cloud credentials, they went after hosted AI model services and secret stores first, valuing premium models over general cloud access.

03

What happened to LiteLLM in October

The second reason people ask whether LiteLLM is safe is a real compromise of the project itself. On October 21, attackers took over LiteLLM’s release pipeline and pushed version 1.107.0 to PyPI and Docker. LiteLLM says that build carried compiled malware that steals credentials and loads remote-code tools, that all earlier versions are safe, and that the bad releases were pulled.

The malicious package sat on PyPI for under two hours and the poisoned Docker tags (including latest, main-latest and main-stable) for a little longer. Several security firms spotted it within six minutes of publication. Researchers name 1.106.2 as the latest clean release.

How did it happen? LiteLLM says the attacker used the GitHub accounts of three of its engineers, apparently with stolen GitHub command-line OAuth tokens: one to change and trigger the release, one to approve it and one to wipe the workflow records. The company found an odd user account on its own internal LiteLLM deployment, which was reachable from the public internet, and believes the tokens were lifted from that deployment’s logs. It suspects a recently patched flaw was the way in, but has not confirmed it.

This was also the project’s second supply chain attack of the year. In March, a group called TeamPCP published malicious LiteLLM versions on PyPI after breaching a scanner used in LiteLLM’s build pipeline. A 153GB archive stolen in that attack was later linked to 2,488 corporate domains.

Night desk with two dark monitors, a coffee mug and a padlock on a notebook
04

Why a poisoned install is worse than it sounds

The October malware did not touch LiteLLM’s own code. It added startup files to Python’s library folder, so it ran every time Python started in that environment, even if your app never imported LiteLLM. Even running Python or pip to investigate set it off.

Once running, it went after a long list of secrets: logins for AWS, Azure, Google Cloud, Kubernetes and Docker, SSH and GPG keys, Git and CI/CD tokens, .env files, saved browser logins and cookies, and the auth files of AI coding tools such as Claude, Codex, Cursor and Gemini. It also tried to read stored provider keys and model settings from LiteLLM proxy databases. Researchers watched stolen AWS keys being tested against Amazon Bedrock AI models about four and a half hours after the data left victims’ machines.

For an ordinary team, that means the risk is not just a surprise AI bill. A single bad install on a build server can hand over the keys to your whole cloud account.

05

How to make LiteLLM safe: eight steps to take now

If you run LiteLLM or a similar gateway, these steps cover both the key hunt and the supply chain problem:

  1. Check your version. If any machine, container or CI runner installed 1.107.0, treat every credential it could reach as stolen. Updating alone does not fix it.
  2. Rebuild, don’t clean. Isolate affected systems and rebuild them from clean backups. Deleting the LiteLLM folder can leave the startup files and loader behind, and avoid starting Python on a suspect machine.
  3. Pin a known-good release. Use an exact version number rather than floating tags like latest, so a hijacked release can’t slip in automatically.
  4. Replace the default master key. Set a long random key of your own, and finish setup before the service is ever reachable.
  5. Keep the admin side private. Put the gateway behind a VPN, private network or login proxy, and make sure no management or settings page answers without authentication.
  6. Rotate provider keys. Assume any key stored in an exposed gateway has been taken. Rotate it, and give new keys the smallest limits your provider allows.
  7. Hunt for leaked secrets. Search configs, environment variables, CI/CD settings, databases and front-end code for embedded keys. Check request logs too, since LiteLLM found that Claude Code can place a GitHub token in a response body that then lands in logs.
  8. Watch your spend. Sudden usage spikes or unfamiliar model calls on your AI accounts are often the first sign a key is in someone else’s pool.

Teams that use Cloudflare should also give API tokens an expiry and IP limits, and look for unexpected Worker scripts with names starting with artex. Cloudflare says static build tokens that never expired were the common root cause in several cases it investigated.

06

Should you stop using LiteLLM?

Not necessarily. Many of the same weaknesses apply to every self-hosted AI app on Amazon’s list, and switching tools won’t help if the new one also sits on the internet with a default password. Enterprise customers using LiteLLM’s private registry were not affected by the October release.

What has changed is the speed. An FBI alert says various hacking crews have been running ARTEX from August or earlier. Its developer pulled its GitHub repository in early October after reports of abuse, yet forks and a paid version remain available. If your gateway is reachable, assume an automated agent will find it.

07

Quick answers

Is LiteLLM safe to install right now?

Yes, if you avoid version 1.107.0 and pin a clean release such as 1.106.2 or a later verified one. The project says all earlier versions are safe and the bad builds were removed.

Was LiteLLM hacked by AI agents?

No. The agent campaign targeted exposed, poorly configured LiteLLM deployments and similar tools. The project’s own breach in October came through hijacked engineer accounts.

How do I know if my AI API key was stolen?

Look for usage you don’t recognize, especially calls to premium models, and check your provider’s billing alerts. If a key sat in an exposed gateway or an infected environment, rotate it anyway.

You're reading the quick version.