The AI Gateway's Secret Door: LiteLLM CVE-2026-42208 Harvests the Framework's Master Keys
TL;DR
A critical pre-authentication SQL injection flaw in LiteLLM (45K GitHub stars, 7.6K forks)—the widely-deployed proxy/SDK layer for unified LLM access—allows unauthenticated attackers to read and modify API keys, provider credentials (OpenAI, Anthropic, Bedrock), and secrets stored in the proxy database. Exploitation began ~36 hours after public disclosure on April 24. Sysdig documented targeted, multi-stage attacks with IP rotation and table-specific queries, suggesting operator familiarity with the codebase. Fix: LiteLLM 1.83.7+.
What Happened
LiteLLM is a popular middleware layer that abstracts multiple LLM providers behind a unified API—a single call route handles OpenAI, Anthropic, Bedrock, and dozens of others. It's widely used by AI/ML teams, startups, and LLM application builders. The project has 45,000 stars on GitHub and is deployed across thousands of development environments and production workloads.
On April 24, a critical SQL injection vulnerability (CVE-2026-42208) was publicly disclosed. The flaw exists in LiteLLM's proxy API key verification logic. An attacker can exploit it without authentication by sending a specially crafted Authorization: Bearer header to any LLM API route (e.g., /chat/completions).
Within 36 hours of disclosure, active exploitation began. According to Sysdig security researchers, the threat actor's behavior was deliberate and surgical:
1. Phase One (Discovery): The attacker sent crafted SQLi payloads targeting /chat/completions and scanned specific database tables containing API keys, provider credentials, environment variables, and configs. Crucially, there were no probes against benign tables—the operator went straight to sensitive data.
2. Phase Two (Escalation): The threat actor switched IP addresses (likely for evasion), re-ran SQLi payloads with more precision based on Phase One reconnaissance, and extracted exact table names and structures.
Sysdig noted: "The operator went straight to where the secrets live," indicating the attacker had prior knowledge of LiteLLM's schema or quickly reverse-engineered it.
Technical Details
Vulnerability Root Cause: LiteLLM's proxy API key verification step used string concatenation to build SQL queries instead of parameterized (prepared) statements. An attacker can inject SQL syntax directly through the Authorization header.
Affected Endpoint: Any route that validates API keys, particularly /chat/completions and other proxy endpoints.
Payload Pattern:
Authorization: Bearer <SQL_INJECTION_PAYLOAD>
Attack Flow:
1. Attacker sends HTTP request with malicious Authorization header
2. LiteLLM concatenates the header value into an unparameterized SQL query
3. SQL injection executes arbitrary queries against the proxy database
4. Attacker extracts API keys, provider credentials (OpenAI token, Anthropic API key, AWS Bedrock credentials), environment secrets, and configuration data
Data at Risk:
- Virtual API keys (for multi-tenant proxy deployments)
- Master keys (LiteLLM administrative credentials)
- Provider credentials (OpenAI, Anthropic, Bedrock, OpenRouter, etc.)
- Environment variables and config secrets
- Model deployment metadata
Exploitation Speed: 36 hours from disclosure to active exploitation—slower than some recent AI infrastructure flaws (e.g., Marimo's pre-auth RCE), but notably deliberate and surgical, suggesting the operator had either advance knowledge or reverse-engineered the vulnerability quickly.
Scope: Any internet-exposed LiteLLM instance running versions prior to 1.83.7 is at immediate risk.
Lyrie Assessment
This is the machine-speed vulnerability supply-chain attack Lyrie was built to detect and block.
Why This Matters for Autonomous Defense:
1. AI Infrastructure Is the New Perimeter: LiteLLM is the glue layer that connects your AI applications to every major LLM provider. A compromise here doesn't just leak credentials—it gives attackers direct access to your entire LLM infrastructure and billing.
2. Speed Asymmetry: The attacker discovered, weaponized, and began extraction within 36 hours. A human-speed patch cycle would have left your instance vulnerable for weeks. Lyrie's continuous reconnaissance and autonomous remediation detection would have flagged this and enforced containment before the operator shifted IPs in Phase Two.
3. The Schema Gamble: The fact that the attacker knew exactly which tables held secrets suggests either:
- Pre-compromised access to LiteLLM's codebase (supply-chain pre-positioning)
- Reverse-engineered familiarity (suggesting this might be the second attack against LiteLLM in a campaign)
The April 26 Lyrie article documented a supply-chain attack that backdoored LiteLLM PyPI packages. This SQL injection might be the opportunistic follow-up.
4. Lateral Movement Gravity: LiteLLM sits at the API boundary between your application and OpenAI/Anthropic/Bedrock. Compromised LiteLLM credentials become the pivot point for:
- Untracked API consumption and billing fraud
- Unauthorized model deployments
- Prompt injection at the gateway layer
- Exfiltration of model outputs
- Token harvesting for downstream lateral movement
5. The Patch-Verification Gap: Lyrie's autonomous validation would verify not just that you patched LiteLLM, but that the patch actually closed the query concatenation (parameterized queries were enforced) and that no backdoored config remained.
Recommended Actions
Immediate (0-2 hours)
1. Identify all instances of LiteLLM in your environment (scan Docker registries, Kubernetes, Lambda, EC2, SaaS deployment logs).
2. Check versions: If any version is < 1.83.7, treat as compromised.
3. Rotate all credentials: OpenAI API keys, Anthropic API keys, Bedrock credentials, LiteLLM master keys, and any virtual keys stored in the database.
4. Review API call logs: Check for unauthorized /chat/completions requests with malicious Authorization headers (SQL syntax, hex-encoded payloads, UNION SELECT patterns).
Short-term (2-24 hours)
1. Patch to LiteLLM 1.83.7 or later and restart all instances.
2. Audit database writes: Check for any config changes, new users, or credential additions made during the exposure window.
3. Check provider logs: Review OpenAI, Anthropic, Bedrock usage logs for unusual activity (unexpected model calls, spike in token consumption, unfamiliar IP origins).
4. Enable WAF rules: If LiteLLM is behind a load balancer or API gateway, add rules to block Authorization headers containing SQL syntax (UNION, SELECT, --, ;, etc.).
Long-term (1-7 days)
1. Network isolation: Move LiteLLM instances off the public internet; gate access via VPN or private endpoint.
2. Secrets rotation cadence: Implement automated credential rotation for all LLM provider keys (monthly minimum).
3. Query audit logging: Enable SQL query logging in your database backend to catch future injection attempts.
4. Lyrie autonomous validation: Deploy Lyrie's continuous reconnaissance to detect similar pre-auth flaw patterns in your AI infrastructure stack (vLLM, Ollama, OpenWebUI, MCP servers, Langflow, Flowise, etc.).
Sources
1. Sysdig Security Research – CVE-2026-42208 Active Exploitation Analysis (https://www.bleepingcomputer.com/news/security/hackers-are-exploiting-a-critical-litellm-pre-auth-sqli-flaw/)
2. LiteLLM GitHub Security Advisory – GHSA-r75f-5x8p-qvmc (http://github.com/BerriAI/litellm/security/advisories/GHSA-r75f-5x8p-qvmc)
3. Bleeping Computer – "Hackers are exploiting a critical LiteLLM pre-auth SQLi flaw" (April 28, 2026)
4. LiteLLM Project – 45K stars, 7.6K forks (https://github.com/BerriAI/litellm)
Lyrie.ai Cyber Research Division
Lyrie Verdict
Lyrie's autonomous defense layer flags this class of exposure the moment it surfaces — no signature update required.