SGLang CVE-2026-5760 (CVSS 9.8) Enables RCE via Malicious GGUF Model Files
好的,我现在需要帮用户总结一篇文章的内容,控制在100字以内。用户的要求是直接写文章描述,不需要特定的开头。首先,我得仔细阅读文章内容,抓住关键点。 文章主要讲的是SGLang框架中的一个严重安全漏洞,CVE-2026-5760,CVSS评分9.8。这个漏洞允许远程代码执行。攻击者通过创建恶意的GGUF模型文件,利用Jinja2模板注入来触发漏洞。影响的是/v1/rerank端点。问题出在使用了jinja2.Environment()而不是ImmutableSandboxedEnvironment。 接下来,我需要将这些信息浓缩到100字以内。要包括漏洞名称、影响、攻击方式、评分以及修复建议。确保语言简洁明了,不遗漏关键信息。 最后,检查一下字数是否符合要求,并确保没有使用任何不需要的开头语句。 </think> SGLang框架发现严重漏洞CVE-2026-5760(CVSS 9.8),攻击者通过恶意GGUF模型文件利用Jinja2模板注入,在/v1/rerank端点实现远程代码执行。该漏洞源于未使用沙盒环境渲染模板。 2026-4-20 17:14:0 Author: thehackernews.com(查看原文) 阅读量:22 收藏

Open Source / Server Security

A critical security vulnerability has been disclosed in SGLang that, if successfully exploited, could result in remote code execution on susceptible systems.

The vulnerability, tracked as CVE-2026-5760, carries a CVSS score of 9.8 out of 10.0. It has been described as a case of command injection leading to the execution of arbitrary code.

SGLang is a high-performance, open-source serving framework for large language models and multimodal models. The official GitHub project has been forked over 5,500 times and starred 26,100 times. 

According to the CERT Coordination Center (CERT/CC), the vulnerability impacts the reranking endpoint "/v1/rerank," allowing an attacker to achieve arbitrary code execution in the context of the SGLang service by means of a specially crafted GPT-Generated Unified Format (GGUF) model file.

"An attacker exploits this vulnerability by creating a malicious GPT Generated Unified Format (GGUF) model file with a crafted tokenizer.chat_template parameter that contains a Jinja2 server-side template injection (SSTI) payload with a trigger phrase to activate the vulnerable code path," CERT/CC said in an advisory released today.

"The victim then downloads and loads the model in SGLang, and when a request hits the "/v1/rerank" endpoint, the malicious template is rendered, executing the attacker's arbitrary Python code on the server. This sequence of events enables the attacker to achieve remote code execution (RCE) on the SGLang server."

Per security researcher Stuart Beck, who discovered and reported the flaw, the underlying issue stems from the use of jinja2.Environment() without sandboxing instead of ImmutableSandboxedEnvironment. This, in turn, enables a malicious model to execute arbitrary Python code on the inference server.

The entire sequence of actions is as follows -

  • An attacker creates a GGUF model file with a malicious tokenizer.chat_template containing a Jinja2 SSTI payload
  • The template includes the Qwen3 reranker trigger phrase to activate the vulnerable code path in "entrypoints/openai/serving_rerank.py"
  • Victim downloads and loads the model in SGLang from sources like Hugging Face
  • When a request hits the "/v1/rerank" endpoint, SGLang reads the chat_template and renders it with jinja2.Environment()
  • The SSTI payload executes arbitrary Python code on the server

It's worth noting that CVE-2026-5760 falls under the same vulnerability class as CVE-2024-34359 (aka Llama Drama, CVSS score: 9.7), a now-patched critical flaw in the llama_cpp_python Python package that could have resulted in arbitrary code execution. The same attack surface was also rectified in vLLM late last year (CVE-2025-61620, CVSS score: 6.5).

"To mitigate this vulnerability, it is recommended to use ImmutableSandboxedEnvironment instead of jinja2.Environment() to render the chat templates," CERT/CC said. "This will prevent the execution of arbitrary Python code on the server. No response or patch was obtained during the coordination process."

Found this article interesting? Follow us on Google News, Twitter and LinkedIn to read more exclusive content we post.


文章来源: https://thehackernews.com/2026/04/sglang-cve-2026-5760-cvss-98-enables.html
如有侵权请联系:admin#unsafe.sh