← Lab /Security & privacy

Compromised LiteLLM admin key lets attackers steal provider credentials and inject responses

Possessing a LiteLLM admin or master key enables an attacker to reroute traffic, harvest backend LLM provider keys, and inject arbitrary responses and tool calls without modifying client configurations.

Security & privacy Embrace The Red 3 Aug 2026 Attack Prototype evidence

Published as “LLM Heist: Hijacking LiteLLM for Traffic Interception, Key Theft, and Tool-Call Injection”

Why it matters

A single compromised AI gateway credential can give an adversary full visibility and control over an organization’s LLM usage, data, and downstream tool execution.

Summary

The authors built a malicious LiteLLM gateway and showed how, with a stolen admin/master key, they can change the /model/update settings to point the victim gateway at their server. This rerouting causes the victim to send its resolved provider API keys to the attacker, which are then harvested and re-used to forward legitimate requests. Using LiteLLM’s callback hooks they inject custom text and forged tool calls into responses, demonstrating full control over the AI traffic. The attack was demonstrated in a lab environment with a single victim instance and a custom llm-heist tool.

What they found 3

  1. Rerouting the victim gateway exposes the backend provider key to the attacker

    “The reconfiguration forces exposing the credential to the attacker-controlled destination. In my lab demo I used HTTP for simplicity.”

  2. An attacker can forge tool calls that appear in the client’s UI

    “The forged Bash tool call now appears in Claude Code:”

  3. Changing api_base and use_litellm_proxy is sufficient to hijack traffic

    “The attack inserts itself as a proxy between the victim’s LiteLLM server and the destination LLM inference endpoints.”

Caveats 6

  • The attack requires possession of the LiteLLM admin/master key or equivalent credential.
  • The authors note that "The routing change itself is not a vulnerability, but finding the credential to make the calls usually is!"
  • Requires access to a valid LiteLLM admin or master key.
  • Demonstrated in a controlled lab; real-world networks may use HTTPS, requiring TLS termination to view keys.
  • Injected tool calls can be blocked if the client enforces strict tool-authorization (non-yolo mode).
  • Harvested keys are only usable while the attacker’s proxy remains in the routing path.

What’s new here 4

  • End-to-end hijack of LiteLLM via admin credential and routing change
  • Live harvesting of backend LLM provider API keys from redirected traffic
  • Response and tool-call injection using LiteLLM’s async_post_call hooks
  • Release of the llm-heist open-source tool and mitigation guidance