Skip to main content
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

Pre-auth SQL Injection in BerriAI LiteLLM proxy API key verification

IdentifiersCVE-2026-42208CWE-89· Improper Neutralization of Special…Also known asghsa_r75f_5x8p_qvmc

CVE-2026-42208 is a critical pre-authentication SQL injection vulnerability in BerriAI LiteLLM, affecting versions 1.81.16 through 1.83.6 (fixed in 1.83.7). During proxy API key verification, LiteLLM used the caller-supplied bearer token value from the Authorization header in SQL query text instead of passing it as a bound parameter. The vulnerable path is reachable on LLM API routes such as POST /chat/completions, /v1/chat/completions, /v1/completions, /v1/messages, and /v1/embeddings. The crafted input reaches the vulnerable PostgreSQL query through the proxy’s key-check and error-handling path. Supporting reporting also identifies the vulnerable logic in LiteLLM’s API key verification flow, including PrismaClient.get_data() / proxy utility code, where unsafe interpolation of the bearer token into a PostgreSQL query enabled blind time-based and other SQLi techniques. The issue was patched in LiteLLM 1.83.7 by replacing raw interpolation with parameterized or typed queries.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

A remote unauthenticated attacker can read data from the LiteLLM proxy database and may be able to modify database contents. Reported high-value targets include virtual API keys, master keys, upstream provider credentials, and environment-variable or configuration data stored by the proxy. Because LiteLLM commonly brokers access to providers such as OpenAI, Anthropic, and AWS Bedrock, compromise can lead to unauthorized access to the proxy itself, theft of managed credentials, abuse of upstream AI services, and potential follow-on compromise of connected AI infrastructure. Some reporting notes that default Docker/PostgreSQL deployments may further increase impact if the application database user has excessive privileges.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, enable general_settings.disable_error_logs: true as the vendor-recommended workaround to reduce exposure by blocking the documented error-handling attack path. This is only an interim mitigation and may not cover all reachable paths described in third-party analysis. Additional mitigations include restricting network exposure of LiteLLM API routes, placing the service behind trusted internal networks or access controls, filtering or validating Authorization bearer formats at a reverse proxy or WAF, and closely monitoring for SQLi indicators, unusual database latency patterns, and suspicious requests to LLM API endpoints.

Remediation

Patch, then assume compromise.

Upgrade LiteLLM to version 1.83.7 or later. The vendor patch replaces the vulnerable SQL construction with parameterized or typed database queries and removes the injection sink without requiring schema changes. After patching, rotate all secrets that may have been exposed on vulnerable internet-facing instances, including LiteLLM virtual API keys, master keys, upstream provider credentials, and any other credentials or environment secrets stored in the proxy database. Review database, application, and proxy logs for suspicious Authorization header values and anomalous access to key-management or provider-integrated resources.
PUBLIC EXPLOITS

Exploits

2 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (6 hidden).

VALID 2 / 8 TOTALView more in app
poc_cve-2026-42208MaturityPoCFrameworknucleiVerified exploit

This repository is a self-contained lab and detection package for CVE-2026-42208, a pre-authentication time-based SQL injection in BerriAI LiteLLM. It is part of the Nuclei ecosystem, and the main exploit artifact is nuclei/CVE-2026-42208.yaml. That template sends two POST requests to /v1/chat/completions: a baseline request with an invalid Bearer token and an injected request using the payload `' OR (SELECT pg_sleep(6)) IS NOT NULL --`. It declares the target vulnerable only if both responses are HTTP 401 and the second response is at least 5.5 seconds slower than the first, reducing false positives from slow networks or upstream 5xx errors. The repository also includes operational Bash scripts and Docker Compose to stand up a vulnerable LiteLLM instance (v1.83.6-nightly on localhost:8010) and a patched comparison instance (v1.83.7-stable on localhost:8011), each backed by separate PostgreSQL 15 containers. scripts/01-setup.sh starts the lab, polls /health/liveliness, and calls /key/generate with the lab master key to ensure at least one verification-token row exists so pg_sleep() is evaluated. scripts/02-exploit.sh is a PoC runner that measures baseline versus injected response times against both instances and prints whether SQL injection is confirmed. scripts/99-teardown.sh removes containers and data. Overall purpose: reproduce, validate, and detect the LiteLLM vulnerability safely in a lab. Main exploit capability: unauthenticated timing-based confirmation of SQL injection in LiteLLM’s Bearer-token authentication path against PostgreSQL-backed deployments. The documentation states the underlying flaw could enable broader database compromise, but the included code focuses on detection/confirmation rather than full post-exploitation.

HAERIN-LDisclosed May 30, 2026markdownyamlwebnetwork
CVE-2026-42208_labMaturityPoCVerified exploit

This repository is a small proof-of-concept and local reproduction setup for a critical SQL injection vulnerability in BerriAI LiteLLM Proxy (GHSA-r75f-5x8p-qvmc). The repo contains four files: a README describing the bug and attack path, a Docker Compose environment that launches vulnerable LiteLLM and PostgreSQL, a LiteLLM YAML config, and a Python PoC script. The main exploit logic is in poc_litellm_sqli.py. It is a Python requests-based script that targets a LiteLLM Proxy HTTP service. It first checks target availability via GET /health, then sends POST requests to /chat/completions with crafted Authorization: Bearer tokens. The exploit intentionally uses a non-'sk-' token so the normal authentication assertion fails and the raw token is propagated into the failure callback chain, eventually reaching a SQL query that interpolates attacker-controlled input. The payload generated by make_payload() is a PostgreSQL time-based blind SQLi string using pg_sleep(): ' OR (SELECT 1 FROM (SELECT pg_sleep(N)) t) IS NOT NULL--. The script measures baseline timing, compares it to the injected request, and declares the target vulnerable if the response delay exceeds a threshold. Capabilities: the PoC demonstrates unauthenticated web-based SQL injection verification against vulnerable LiteLLM instances. It does not include automated exfiltration, shell access, persistence, or post-exploitation modules. However, the README explicitly notes the likely impact as database read access via blind injection, potentially exposing API keys, credentials, and proxy-managed provider secrets. Repository structure and purpose: docker-compose.yaml provisions PostgreSQL 16 and LiteLLM v1.83.3-stable on ports 5432 and 4000 respectively, with a DATABASE_URL and master key configured for local testing. litellm_config.yaml defines a minimal model configuration and references environment variables for the master key and database URL. README.md documents affected versions (>=1.81.16, <1.83.7), the vulnerable code path, example commands, and expected output. Overall, this is a legitimate PoC/reproduction repository intended to validate and demonstrate the LiteLLM Proxy SQL injection issue rather than a full exploitation toolkit.

imjdlDisclosed Apr 28, 2026pythonyamlwebnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
BerriAILitellmapplication
LitellmLitellmapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures1

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity109

Community discussion across Reddit, Mastodon, and other social sources.