Add LiteLLM proxy pre-auth SQL injection scanner (CVE-2026-42208)#21567
Open
kenlacroix wants to merge 1 commit into
Open
Add LiteLLM proxy pre-auth SQL injection scanner (CVE-2026-42208)#21567kenlacroix wants to merge 1 commit into
kenlacroix wants to merge 1 commit into
Conversation
Adds an auxiliary/scanner/http module that detects BerriAI LiteLLM proxy servers affected by CVE-2026-42208, an unauthenticated SQL injection where the raw Authorization bearer value is interpolated into a PostgreSQL query during key verification. The module uses a benign time-based check (pg_sleep with a differential, scaling comparison) and reports the target vulnerable only when the injected delays scale while the controls stay fast. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
auxiliary/scanner/http/litellm_proxy_sqli, a detection module forCVE-2026-42208 (CVSS 9.3,
on the CISA KEV list) — a pre-authentication SQL injection in
BerriAI LiteLLM proxy.
Vulnerability
During API-key verification the proxy interpolates the raw
Authorizationbearervalue into a PostgreSQL query without parameterization:
LiteLLM only SHA-256-hashes bearer tokens that begin with
sk-; a value that doesnot start with
sk-reaches the query verbatim, so a single quote breaks out ofthe string literal. The lookup runs on the authentication-failure path, which is
reachable before authentication. Affected versions are
1.81.16through1.83.6;fixed in
1.83.7by switching to a parameterized query (commit4dc416ee74).What the module does
This is a detection module. It confirms the flaw with a benign time-based
check and never reads or exfiltrates data:
sk-bearer.pg_sleep(N)payload.pg_sleep(2N)payload.The target is reported vulnerable only when the injected delays scale with the
requested sleep while both controls stay fast, so a server that is merely slow or
degrading is not flagged.
Detection requirement: the injectable predicate is a
WHEREclause PostgreSQLevaluates per matching row, so the time-based signal only fires when the target has
provisioned at least one virtual key (a non-empty token table). This is the case
for any LiteLLM proxy in real use; a freshly initialized proxy with no keys may not
respond. The limitation is documented in the module and the docs.
Verification
Tested against the official images — vulnerable
main-v1.83.3-stableand patchedmain-v1.83.7-stable, each with a PostgreSQL backend and one provisioned virtualkey:
checkreturnsVulnerable/Saferespectively. The module also degrades cleanly(reports not vulnerable, no errors) against a non-LiteLLM HTTP server and against a
vulnerable proxy whose token table is empty.
Documentation with the full Docker lab setup and scenarios is included at
documentation/modules/auxiliary/scanner/http/litellm_proxy_sqli.md.Verification Steps
use auxiliary/scanner/http/litellm_proxy_sqliset RHOSTS <target>run— the module reports the injection when the response time scales withpg_sleep