{"id":651,"date":"2026-04-20T18:58:26","date_gmt":"2026-04-20T18:58:26","guid":{"rendered":"https:\/\/thedigitalfortress.us\/?p=651"},"modified":"2026-04-20T18:58:26","modified_gmt":"2026-04-20T18:58:26","slug":"sglang-cve-2026-5760-cvss-9-8-enables-rce-via-malicious-gguf-model-files","status":"publish","type":"post","link":"https:\/\/thedigitalfortress.us\/?p=651","title":{"rendered":"SGLang CVE-2026-5760 (CVSS 9.8) Enables RCE via Malicious GGUF Model Files"},"content":{"rendered":"<div>\n<p><span class=\"p-author\"><i class=\"icon-font icon-user\">\ue804<\/i><span class=\"author\">Ravie Lakshmanan<\/span><i class=\"icon-font icon-calendar\">\ue802<\/i><span class=\"author\">Apr 20, 2026<\/span><\/span><span class=\"p-tags\">Open Source \/ Server Security<\/span><\/p>\n<\/div>\n<div id=\"articlebody\">\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhHmSpfy0MbO4mTB5B4TYrJzfBNO0HD2Z194J1U3YlwUQpQsTGompmNqR7_Rx4nbgPXHs3Mel7tBcZDXOVeYDXev1luKnr5VUzbmPornwB-bcciiA_Zvmam5q9lwPK5b9K-my0_a1VBjA-2Pjmb31yWEiyBAl_ipNM5gvJM19yxcT-Q468-8VL8KrfCYHen\/s1700-e365\/sgll.jpg\" style=\"display: block;  text-align: center; clear: left; float: left;\"><\/a><\/div>\n<p>A critical security vulnerability has been disclosed in <b>SGLang <\/b>that, if successfully exploited, could result in remote code execution on susceptible systems.<\/p>\n<p>The vulnerability, tracked as <strong><a href=\"https:\/\/www.cve.org\/CVERecord?id=CVE-2026-5760\">CVE-2026-5760<\/a><\/strong>, 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.<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/2312.07104\">SGLang<\/a> is a high-performance, open-source <a href=\"https:\/\/docs.sglang.io\/index.html\">serving framework<\/a> for large language models and multimodal models. The official GitHub project has been forked over 5,500 times and starred 26,100 times.\u00a0<\/p>\n<p>According to the CERT Coordination Center (CERT\/CC), the vulnerability impacts the reranking endpoint \u00ab\/v1\/rerank,\u00bb 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 (<a href=\"https:\/\/www.ibm.com\/think\/topics\/gguf-versus-ggml\">GGUF<\/a>) model file.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/ai-blindspot-d-2\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjXdwBgwvGAvD2t1bXXwTy6zsfnReMp12VglYCBAv0j9Tc0_gLKPqF5HJO1kOv26ZcGRlQJ1kRXGvtIusmtnUGUjonzq8YEigkMhMJvk_Cta9TYHzMvqVfa5SvoH-Z9-kw5VEH8sPeI1YKKrzFeNYp0Cn7mEGMn6PXOs0waZDIWKI5nccOxPyJR8MDQMasu\/s728-e100\/nudge-d-2.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>\u00abAn 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 (<a href=\"https:\/\/www.imperva.com\/learn\/application-security\/server-side-template-injection-ssti\/\">SSTI<\/a>) payload with a trigger phrase to activate the vulnerable code path,\u00bb CERT\/CC <a href=\"https:\/\/kb.cert.org\/vuls\/id\/915947\">said<\/a> in an advisory released today.<\/p>\n<p>\u00abThe victim then downloads and loads the model in SGLang, and when a request hits the \u00ab\/v1\/rerank\u00bb endpoint, the malicious template is rendered, executing the attacker&#8217;s arbitrary Python code on the server. This sequence of events enables the attacker to achieve remote code execution (RCE) on the SGLang server.\u00bb<\/p>\n<p>Per security researcher Stuart Beck, who <a href=\"https:\/\/github.com\/Stuub\/SGLang-0.5.9-RCE\">discovered and reported the flaw<\/a>, 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.<\/p>\n<p>The entire sequence of actions is as follows &#8211;<\/p>\n<ul>\n<li>An attacker creates a GGUF model file with a malicious tokenizer.chat_template containing a Jinja2 SSTI payload<\/li>\n<li>The template includes the Qwen3 reranker trigger phrase to activate the vulnerable code path in \u00abentrypoints\/openai\/serving_rerank.py\u00bb<\/li>\n<li>Victim downloads and loads the model in SGLang from sources like Hugging Face<\/li>\n<li>When a request hits the \u00ab\/v1\/rerank\u00bb endpoint, SGLang reads the chat_template and renders it with jinja2.Environment()<\/li>\n<li>The SSTI payload executes arbitrary Python code on the server<\/li>\n<\/ul>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/fast-response-not-fast-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjgi9mu68zRUz1nCLLKmkAA2aBtNfP_JOTXulZoB6yImso1Onk7oM_LI0kdROu8fq5S5oDyMtd1j50W44Ye_8Sl3zQZiE8A9tmFr6kejGKjGh74uoxluF-RyBq_unDQlzjXZHCqQeuYXBoogda5zf0w-zXd6v0rIM7fEw6TcFf_QGWBu5Mop-djkEaOUa5A\/s728-e100\/tl-d.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>It&#8217;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 (<a href=\"https:\/\/github.com\/advisories\/GHSA-6fvq-23cw-5628\">CVE-2025-61620<\/a>, CVSS score: 6.5).<\/p>\n<p>\u00abTo mitigate this vulnerability, it is recommended to use ImmutableSandboxedEnvironment instead of jinja2.Environment() to render the chat templates,\u00bb CERT\/CC said. \u00abThis will prevent the execution of arbitrary Python code on the server. No response or patch was obtained during the coordination process.\u00bb<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ue804Ravie Lakshmanan\ue802Apr 20, 2026Open 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.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":652,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1306,497,724,236,1307,33,111,316,720],"class_list":["post-651","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-cve20265760","tag-cvss","tag-enables","tag-files","tag-gguf","tag-malicious","tag-model","tag-rce","tag-sglang"],"_links":{"self":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=651"}],"version-history":[{"count":0,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/651\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/media\/652"}],"wp:attachment":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}