CVE-2026-7669: SGLang has an Improper Input Validation/Injection Issue
SGLang's get_tokenizer, in hf_transformers_utils.py, can end up loading a model's custom tokenizer code even when the operator asked for trust_remote_code=False. A model from an untrusted source can then run code in the SGLang server process. The advisory lists versions up to 0.5.9 and no patched release, and a public write-up gives conflicting version details.
Published May 3, 2026 · Updated May 7, 2026 · Analysis Nov 4, 2026
What an attacker can do
The advisory describes the flaw as a deserialization problem in get_tokenizer, reachable remotely but rated high complexity and difficult. The vendor did not respond. A public proof-of-concept write-up explains a concrete mechanism. With transformers v5, a call with trust_remote_code=False returns a generic TokenizersBackend built from tokenizer.json, and does not run the model's custom tokenizer.py. SGLang then sees that generic backend at lines 898-909 of hf_transformers_utils.py and calls from_pretrained a second time with trust_remote_code=True. Transformers then imports the custom tokenizer code, and its top-level statements run inside the SGLang process. The write-up says no log line is emitted.
The attacker needs the operator to launch SGLang with a model path they control, such as a Hugging Face repo whose config uses a custom tokenizer_class with an auto_map entry. The write-up claims access to environment variables such as API tokens, file writes and outbound network calls. Those claims come from the PoC author. The write-up also says no HTTP endpoint calls get_tokenizer after startup, so this is not a network attack on a running server. The advisory's own scores are medium (CVSS 3.1: 5.6; CVSS 4.0: 6.3).
Who is affected
The advisory lists the pip package sglang at 0.5.9 and below. The public PoC page says the opposite: affected from 0.5.10 through main, not 0.5.9 or earlier. Treat the version range as unconfirmed. The behavior depends on transformers v5 and a model that ships custom tokenizer code. Check:
pip show sglang transformerssglang
- Ecosystem
- PyPI
- Affected
- <= 0.5.9
- Fixed in
- No patched version yet
- Check
pip show sglang
How to fix it
No patched version is listed in the advisory. Practical steps from the sources: launch SGLang only with model paths you trust and have reviewed, and pin model revisions. The PoC author suggests removing the second from_pretrained call at lines 898-909, so operators who need custom tokenizer code must pass --trust-remote-code themselves. A warning log and a return of the generic backend is an alternative. Watch the sgl-project repository for a release that addresses it. Run model servers with minimal secrets in their environment.
How to tell if you were hit
Review which model paths your SGLang servers loaded, and check them for a custom tokenizer_class, an auto_map entry and a tokenizer.py file. Look at the SGLang process for unexpected child processes, outbound connections at startup, new files in the SGLang or model directories, and pip installs. The write-up says the override logs nothing, so absence of a log line proves nothing.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A vulnerability was detected in sgl-project SGLang up to 0.5.9. Impacted is the function get_tokenizer of the file python/sglang/srt/utils/hf_transformers_utils.py of the component HuggingFace Transformer Handler. The manipulation results in deserialization. The attack can be executed remotely. A high complexity level is associated with this attack. The exploitability is considered difficult. The vendor was contacted early about this disclosure but did not respond in any way.
Questions
- Is there a patched SGLang for CVE-2026-7669?
Not yet. The advisory lists no fixed release, and the vendor did not respond to disclosure.
- Can an attacker hit a running SGLang server over the network?
The advisory says the attack is remote but difficult. The PoC write-up says no HTTP endpoint calls get_tokenizer after startup, so the trigger is loading an attacker-controlled model.
- Which versions are affected?
The advisory says 0.5.9 and below. The PoC write-up claims 0.5.10 and later instead. The sources conflict, so check the code at lines 898-909 of hf_transformers_utils.py.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More SGLang vulnerabilities
All SGLang entriesCVE-2026-10775
SGLang is Vulnerable to DoS via the data_hash Function
low3.6No fixJun 4, 2026CVE-2026-10300
SGLang: Reachable Assertion via lora_path in LoRAManager enables remote Denial of Dervice
low3.7No fixJun 2, 2026CVE-2026-7301
SGLanG: Multimodal scheduler deserializes untrusted pickle data on 0.0.0.0 ROUTER socket
critical9.8No fixMay 18, 2026CVE-2026-7302
SGLang's multimodal generation runtime has an unauthenticated path traversal vulnerability
critical9.1No fixMay 18, 2026CVE-2026-7304
SGLang: Unauthenticated RCE via --enable-custom-logit-processor
critical9.8No fixMay 18, 2026CVE-2026-3059
SGLang's multimodal generation module is vulnerable to unauthenticated remote code execution through the ZMQ broker
critical9.8Mar 12, 2026
