[KEV] SQL Injection in Berriai litellm (CVE-2026-42208)
Summary
SQL injection in Berriai litellm (CVE-2026-42208). Successful exploitation can lead to full system takeover. Exploitable via POST /chat/completions. Listed in CISA KEV — actively exploited. Mitigation: upgrade to >=1.83.7 or later.
Original description
The description as published by the source.
Impact
A database query used during proxy API key checks mixed the caller-supplied key value into the query text instead of passing it as a separate parameter. An unauthenticated attacker could send a specially crafted Authorization header to any LLM API route (for example POST /chat/completions) and reach this query through the proxy's error-handling path.
An attacker could read data from the proxy's database and may be able to modify it, leading to unauthorised access to the proxy and the credentials it manages.
Patches
Fixed in 1.83.7. The caller-supplied value is now always passed to the database as a separate parameter. Upgrade to 1.83.7 or later.
Workarounds
If upgrading is not immediately possible, set disable_error_logs: true under general_settings. This removes the path through which unauthenticated input reaches the vulnerable query.
References
- Patched release:
v1.83.7-stable
Discovery Credit: Tencent YunDing Security Lab
Source: CISA Known Exploited Vulnerabilities NVD GitHub Advisory CISA KEV
AI summary
Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.
A vulnerability in BerriAI LiteLLM allows unauthorized access to its database, risking data theft. This issue occurs during API key verification, making it crucial for users to update their systems. If immediate update is not possible, a temporary setting change can mitigate the risk.
BerriAI LiteLLM has a SQL injection vulnerability in the POST /chat/completions endpoint where the Authorization header is used during API key verification. This allows attackers to read or modify the database. Affected versions are from 1.81.16 to <1.83.7, with a fix in 1.83.7. As a workaround, set disable_error_logs: true in general_settings. CVSS score is 9.8, indicating remote exploitability and no user interaction required. Discovered by Tencent YunDing Security Lab.
SQL injection vulnerability in BerriAI LiteLLM's API key verification process.
Affects POST /chat/completions endpoint using the Authorization header.
Critical (CVSS score 9.8) indicating remote exploitability without requirements for authentication or user interaction.
Upgrade to version 1.83.7 or later.
Set disable_error_logs: true in general_settings.
Monitor for unusual manipulation of the Authorization header data in logs.
Related past incidents Similar incidents extracted from past CVEs
Another significant SQL injection vulnerability affecting authorization processes in similar systems.
Example of a SQL injection vulnerability exploited via an API header.
Historical highlight of the impact SQL injection can have on large systems.
If this happens at your company Expected impact per business scenario
Unauthorized read/write access to databases leading to sensitive business data exposure.
Potential breach of PII, leading to regulatory fines and damage to client trust.
Compromised infrastructure that leads to operational disruptions and data leaks.
Immediate upgrade to patched version 1.83.7 and review error logging configurations.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'litellm' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
litellmを grep し、稼働しているサービス・バージョンを把握する。 -
2Match against affected range verify
Confirm if version satisfies `>=1.81.16, <1.83.7`Step 1 で見つかったバージョンが影響範囲
>=1.81.16, <1.83.7に該当するか照合。本番で稼働中ならインシデント扱い。 -
3Hunt for indicators of compromise detect
grep 'POST /chat/completions' /var/log/nginx/access.log | grep -E '(unusual_payload|sqli_pattern)'アクセスログで
POST /chat/completionsへの異常なリクエスト (不正な認証ヘッダ・SQLメタ文字)を過去 30〜90日分捜索。WAF/SIEM があれば該当パスのアラート発火履歴を確認。 -
4Consider incident declaration escalate
Notify SOC / on-callCISA KEV登録済 = 実環境で悪用が観測されている。Step 3 で兆候があればインシデント対応宣言、無くてもパッチ適用までWAF強化を最優先で。
-
5Apply temporary workaround mitigate
set `disable_error_logs: true` under `general_settings`.パッチが適用されるまでの応急処置として、set
disable_error_logs: trueundergeneral_settings. を実施。回避策の副作用 (機能低下) を確認した上で。 -
6Apply patch patch
Upgrade litellm to >=1.83.7ステージング環境で >=1.83.7 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスと、Step 3 で見つけた異常検知の続報チェックを含めること。
-
7Post-deployment verification verify
Replay attack against POST /chat/completions on staging to confirm patch closes the vectorパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 3 と同じログクエリでアラート再発が無いか継続監視。
Affected packages
References
- advisory security.access.redhat.com
- web nvd.nist.gov
- web github.com
- web github.com
- web cisa.gov
- web github.com
- web github.com
- web access.redhat.com
- web bugzilla.redhat.com
- web pypi.org
- web github.com