Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization in SGLang ZMQ Multimodal Generation

CVE-2026-3059

Modified

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Unauthenticated Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SGLang's multimodal generation module exposes a remote code execution risk by deserializing attacker-controlled data over a ZMQ broker using Python's pickle.loads() without any authentication.

An unauthenticated attacker who can reach the ZMQ endpoint may execute arbitrary code in the SGLang process context, potentially compromising the host and any connected workloads.

Affected context

This vulnerability occurs in deployments of SGLang that expose the multimodal generation module via a ZeroMQ (ZMQ) broker and rely on pickle-based message deserialization.

It is most relevant when:

  • The ZMQ broker is reachable over a network (e.g., intra-cluster or public-facing),
  • No authentication, encryption, or network-level isolation is enforced for that broker,
  • The same process has access to sensitive models, data, or system resources.

Exploit preconditions

  • Attack surface: Network-accessible ZMQ broker used by the SGLang multimodal generation module.
  • Required access: Ability to open a connection to the broker endpoint (no credentials required).
  • Trigger point: Sending crafted serialized payloads that will be processed by pickle.loads() on the server side.
  • Why exploitation is possible: Python's pickle format allows embedding object types and behaviors which are executed during deserialization, and the server treats incoming data as trusted without authentication or origin validation.

Why this happens

The core issue is the use of Python's pickle.loads() on untrusted, remote input, which directly maps to CWE-502: Unsafe Deserialization.

Pickle is a general-purpose serialization format that can instantiate arbitrary Python objects and execute their special methods during loading. When used on data received over a network without authentication or integrity checks, an attacker can craft payloads that cause execution of arbitrary code on deserialization.

In the SGLang multimodal generation module, the ZMQ broker acts as a message transport but does not enforce a trust boundary, allowing arbitrary clients to send data that is implicitly trusted and deserialized as if it originated from a benign, internal component.

Potential impact

  • Execution of arbitrary code with the privileges of the SGLang process.
  • Full compromise of the host running the SGLang instance, depending on OS-level isolation.
  • Theft or tampering of models, prompts, and generated data.
  • Lateral movement to adjacent services or systems reachable from the compromised host.
  • Use of the compromised instance for further attacks (e.g., data exfiltration, cryptomining, or supply-chain manipulation).

General mitigation guidance

Since the vulnerability stems from unsafe deserialization of untrusted network data, mitigations generally focus on removing implicit trust and reducing deserialization capabilities:

  • Replace pickle with a safer, data-only serialization format (e.g., JSON, MessagePack, or protocol buffers) that cannot encode arbitrary code execution behavior.
  • Introduce strong authentication and authorization around message brokers so only trusted components can connect and send data.
  • Constrain accepted message types through explicit schemas and validation, rejecting data that does not conform.
  • Run the multimodal generation service under least-privilege accounts and within sandboxed or containerized environments to limit damage from a compromise.
  • Apply network segmentation and firewall rules so the ZMQ broker is never exposed beyond the minimum required scope (ideally restricted to a private service network).

How teams detect issues like this

Detection efforts can focus on both code-level patterns and runtime behavior:

  • Use static analysis or code scanning rules to flag uses of pickle.loads(), pickle.load(), or equivalent unsafe deserialization APIs on data that can cross process or network boundaries.
  • During code review, treat any serialization/deserialization on socket, broker, or RPC paths as high-risk and verify that only data-only formats are used.
  • Implement runtime monitoring for unusual child processes, filesystem changes, or outbound connections originating from the SGLang service, which can indicate successful exploitation.
  • Incorporate security policy checks in CI/CD pipelines that fail builds when high-risk deserialization patterns are present without appropriate justification and controls.

Sources

SourceLink
github.comgithub.com/sgl-project/sglang/blob/main/python/sglang/multimodal_gen/runtime/scheduler_client.py
github.comgithub.com/sgl-project/sglang/pull/20904
github.comgithub.com/sgl-project/sglang/releases/tag/v0.5.10
github.comgithub.com/sgl-project/sglang/security/advisories/GHSA-3cp7-c6q2-94xr
orca.securityorca.security/resources/blog/sglang-llm-framework-rce-vulnerabilities/

Frequently asked

questions

Yes. If an attacker can reach the ZMQ broker endpoint for the multimodal generation module, they can attempt to send malicious pickle payloads without needing prior authentication.

No. The described configuration does not enforce authentication on the ZMQ broker, so exploitation only requires network connectivity to the service and the ability to send crafted messages.

The most robust approach is to eliminate pickle-based deserialization for network-facing data entirely and adopt a data-only serialization format combined with explicit schema validation. Complement this with enforcing authentication and authorization on message brokers.

Establish a design rule that generic deserialization mechanisms like pickle, Java serialization, or language-specific object graphs are never used across trust boundaries. Instead, use constrained, documented data formats, enforce strict authentication and network isolation for internal services, and run automated checks that flag unsafe deserialization as a blocking issue in development workflows.

Find out what's already
exploitable in your codebase.