CVE-2026-7304: SGLang: Unauthenticated RCE via --enable-custom-logit-processor
When SGLang runs with --enable-custom-logit-processor, its generation endpoints accept a custom_logit_processor field and load it with dill.loads() without validation. An unauthenticated request carrying a crafted dill payload runs code on the server. Versions 0.4.1.post7 through 0.5.12 are affected and no patch exists. Keep the flag off.
Published May 18, 2026 · Updated May 29, 2026 · Analysis Oct 27, 2026
What an attacker can do
The custom_logit_processor field of a generation request carries a JSON object whose callable property is a hex-encoded dill payload. _cache_from_str() in python/sglang/srt/sampling/custom_logit_processor.py (around lines 14-20) passes it to dill.loads(). Dill, like pickle, runs code while loading, so a crafted payload executes as the SGLang process.
The flag is off by default, which limits exposure. But SGLang's documentation recommends enabling it for models such as DeepSeek-R1 and GLM-4, so real deployments turn it on. The attacker needs to reach a generation endpoint and needs no login. The result is code execution on the inference host, with access to model weights, API keys, cloud credentials and anything else the process can read.
The maintainers did not respond during coordination, according to the researchers. CERT/CC published VU#777338 on 2026-05-15, covering this and related SGLang issues. This flaw reaches back further than the multimodal ones, to 0.4.1.post7.
Who is affected
SGLang 0.4.1.post7 through 0.5.12, only when the server is started with --enable-custom-logit-processor and a generation endpoint is reachable. Check the version and the launch flags:
pip show sglang
ps aux | grep enable-custom-logit-processorAlso check Compose files, Kubernetes manifests and systemd units for the flag.
sglang
- Ecosystem
- PyPI
- Affected
- >= 0.4.1.post7, <= 0.5.12
- Fixed in
- No patched version yet
- Check
pip show sglang
How to fix it
There is no official patch. The packages data lists no patched version, and the researchers report none is available.
Mitigations from the sources: do not expose SGLang's service interfaces to untrusted networks, and keep --enable-custom-logit-processor off unless you need it. If you need it, restrict who can send requests with an authenticating proxy or network policy, since any caller who can reach the endpoint can use the field. Watch for a release after 0.5.12.
How to tell if you were hit
Search request logs or proxy captures for generation requests that include a custom_logit_processor field from clients that should not use it, especially with a long hex callable string. On the server, look for unexpected child processes of the sglang process, new outbound connections and changes to files it can write. Confirm whether the flag is set on each running instance.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
SGLang's multimodal generation runtime is vulnerable to unauthenticated remote code execution when the --enable-custom-logit-processor option is enabled, as Python objects loaded via dill.loads() will be deserialized without validation.
Questions
- Am I affected if I do not use --enable-custom-logit-processor?
The advisory ties the flaw to that option, which is off by default. Without it, this deserialization path is not reachable. Check your launch flags to be sure.
- Why do people enable the flag?
The researchers note that SGLang's documentation recommends it for models such as DeepSeek-R1 and GLM-4, so many deployments have it on.
- Is there a patch for CVE-2026-7304?
No. 0.5.12 is the last version listed as vulnerable, and no patched release is reported. Restrict network access and disable the flag where possible.
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-7669
SGLang has an Improper Input Validation/Injection Issue
medium5.6No fixMay 3, 2026CVE-2026-3059
SGLang's multimodal generation module is vulnerable to unauthenticated remote code execution through the ZMQ broker
critical9.8Mar 12, 2026
