Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization in SGLang Multimodal Runtime Router

CVE-2026-7301

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution over Network

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 runtime scheduler exposes a ROUTER socket bound to 0.0.0.0 that deserializes incoming messages using pickle.loads() without enforcing trust boundaries.

When this socket is reachable from untrusted networks, a remote attacker can craft malicious pickle payloads that lead to arbitrary code execution on the host running the scheduler.

Affected context

This vulnerability occurs in deployments of the SGLang multimodal generation runtime where the scheduler's ROUTER socket is left at its default network binding (0.0.0.0) and accepts serialized messages from external clients.

The risk increases significantly when the runtime is exposed directly to the internet or to untrusted internal networks (e.g., shared clusters, multi-tenant environments) without additional isolation, authentication, or network-level access controls.

Exploit preconditions

  • Attack surface: Network-accessible ROUTER socket exposed by the SGLang multimodal runtime scheduler
  • Required access: Ability to open a TCP connection to the scheduler's listening port (no prior authentication required, if not otherwise enforced)
  • Trigger point: Sending a crafted message containing a malicious Python pickle object that is passed to pickle.loads()
  • Why exploitation is possible: Python's pickle protocol is designed for object serialization between trusted endpoints and allows arbitrary code execution during deserialization; using it on untrusted network data without validation or sandboxing directly maps to unsafe deserialization

Why this happens

The core issue is the use of Python's pickle.loads() on data received directly from a network socket that listens on all interfaces by default.

pickle is a powerful but insecure serialization format that can instantiate arbitrary Python objects and execute attacker-controlled code as part of the deserialization process.

By combining an unauthenticated, globally bound ROUTER socket (0.0.0.0) with blind trust in incoming serialized payloads, the runtime effectively treats external network traffic as executable data, which corresponds to CWE-502: Deserialization of Untrusted Data.

Potential impact

  • Remote execution of arbitrary code with the privileges of the SGLang scheduler process
  • Takeover of the host machine running the multimodal generation runtime
  • Lateral movement within the surrounding infrastructure or Kubernetes cluster
  • Exfiltration or tampering of in-memory model data, prompts, and generation outputs
  • Use of the compromised host as a pivot point for further attacks within the environment

General mitigation guidance

Effective mitigation focuses on eliminating unsafe deserialization and narrowing the network trust boundary:

  • Replace pickle with a safer, non-executable serialization format (e.g., JSON, MessagePack, Protobuf) for all untrusted network inputs.
  • Restrict the scheduler's network binding to local or explicitly trusted interfaces instead of 0.0.0.0, and place it behind authenticated, access-controlled frontends or gateways.
  • Introduce strong authentication and authorization at the protocol or transport layer (e.g., mTLS, API tokens) so that only trusted clients can reach the scheduler.
  • Run the scheduler under least-privilege OS accounts and, where possible, inside hardened containers or sandboxes to minimize the blast radius of potential compromise.
  • Apply network segmentation and firewall rules to ensure the ROUTER socket is not directly reachable from the public internet or untrusted segments.

How teams detect issues like this

Detection typically involves both code-centric and infrastructure-centric approaches:

  • Static analysis: Flag use of pickle.loads() (and related APIs) on data originating from sockets, message queues, or other external inputs; enforce rules that disallow pickle in network protocols.
  • Code review: Look for networking code that binds to 0.0.0.0 and performs object deserialization; verify that only schema-validated, non-executable formats are used for cross-boundary communication.
  • Runtime monitoring: Monitor process behavior for suspicious child processes, abnormal file system access, or unexpected network connections initiated by the scheduler process.
  • Configuration and policy enforcement: Use infrastructure-as-code scanning and security policies to detect externally exposed ports for the SGLang runtime and require authentication and restricted bindings.

Sources

SourceLink
antiproof.aiantiproof.ai/blog/three-rces-in-sglang/
github.comgithub.com/sgl-project/sglang/tree/main/python/sglang

Frequently asked

questions

Yes, if the scheduler's ROUTER socket is reachable from the internet or any untrusted network without additional protections, an attacker can remotely exploit it by sending crafted pickle payloads.

The attacker only needs network-level access to the exposed port; no valid credentials are required if the deployment does not implement its own authentication or network filtering.

The safest approach is to remove pickle from the network protocol entirely, adopting a non-executable serialization format and ensuring the scheduler is not bound to 0.0.0.0 in untrusted environments.

Avoid using executable serialization mechanisms (like pickle) across trust boundaries, design external APIs around structured, schema-validated data formats, enforce secure-by-default network bindings, and integrate static analysis and secure code review practices that flag unsafe deserialization patterns early.

Find out what's already
exploitable in your codebase.