# CVE-2026-7304: SGLang RCE via unsafe deserialization in custom logit processor

Source: https://junglewise.ai/threats/cve-2026-7304-sglang-rce-via-unsafe-deserialization-in-custom-logit-processor  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-18. Updated: 2026-05-29  
License: CC BY 4.0 with a link back

CVE-2026-7304 · Severity: critical · CVSS 9.8 · Published 2026-05-18

SGLang is an open-source framework used to serve large language models (LLMs) and AI models. A critical security flaw exists when the custom logit processor feature is enabled, allowing an unauthenticated attacker to execute arbitrary commands on the server. This could lead to a complete system takeover, theft of sensitive AI models or data, and disruption of AI services.

Technologies: [sglang (PyPI)](https://junglewise.ai/threats/technologies/pypi-sglang), [SGLang Project SGLang](https://junglewise.ai/threats/technologies/sglang). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi), [SGLang Project](https://junglewise.ai/threats/vendors/sglang-project).

## Quick answers

**Is CVE-2026-7304 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-7304 being exploited in the wild.

**How severe is CVE-2026-7304?** Critical severity, with a CVSS score of 9.8, published 18 May 2026.

**Which products and versions are affected?** sglang (PyPI) ECOSYSTEM:introduced=0.4.1.post7,last_affected=0.5.12; SGLang Project SGLang >= 0.4.1.post7, <= 0.5.12, v0.4.1.post7 and later.

**Is there a fix for CVE-2026-7304?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-7304 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-7304?** Check whether you run sglang (PyPI) or SGLang Project SGLang at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A deserialization vulnerability (CWE-502) exists in SGLang's custom logit processor component. When the '--enable-custom-logit-processor' flag is set, the generation endpoint accepts a 'custom_logit_processor' field containing a hex-encoded 'dill' payload. The server invokes 'dill.loads()' on this untrusted input without validation, allowing a remote, unauthenticated attacker to achieve arbitrary code execution. This affects versions 0.4.1.post7 through 0.5.12; as of the advisory date, no official patch is available, and users are advised to disable the vulnerable flag and restrict network access.

## Affected products

- SGLang Project sglang >= 0.4.1.post7, <= 0.5.12

## Identifiers

- CVE-2026-7304
- GHSA-36m8-w8qf-g76p
- PYSEC-2026-535

## Timeline

- 2026-03-10: disclosed: Vulnerability reported to maintainers by Antiproof.
- 2026-05-15: advisory: CERT/CC published Vulnerability Note VU#777338.
- 2026-05-18: disclosed: GitHub Advisory and NVD entry published.

## References

- [https://antiproof.ai/blog/three-rces-in-sglang](https://antiproof.ai/blog/three-rces-in-sglang)
- [https://github.com/sgl-project/sglang/tree/main/python/sglang](https://github.com/sgl-project/sglang/tree/main/python/sglang)

## Related threats

- [SGLang uncontrolled memory allocation in Mooncake disaggregation backend](https://junglewise.ai/threats/cve-2026-112270-sglang-through-0-5-22-with-the-mooncake-disaggregation-backend)
- [SGLang Mooncake disaggregation backend unauthenticated denial of service](https://junglewise.ai/threats/cve-2026-112269-sglang-through-0-5-22-with-the-mooncake-disaggregation-backend)
- [SGLang server-side request forgery in prefill/decode disaggregation](https://junglewise.ai/threats/cve-2026-112267-sglang-through-0-5-22-in-prefill-decode-disaggregation-mode)
- [SGLang cache poisoning via untrusted mm_hashes in multimodal prefix cache](https://junglewise.ai/threats/cve-2026-111392-sglang-through-0-5-21-trusts-caller-supplied-mm-hashes-values-as)
- [SGLang code injection in _evaluate_filter()](https://junglewise.ai/threats/cve-2026-111391-sglang-0-5-10-through-0-5-22-contains-a-code-injection)
