/

CVE-2025-66455

Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization (CWE-502) in LMDeploy DistServe

CVE-2025-66455

Awaiting Analysis

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

A critical unsafe deserialization vulnerability in LMDeploy's PyTorch DistServe control plane allows attacker-controlled data received over ZeroMQ to be processed with Python pickle.

When an attacker can reach an affected DistServe API server and influence its peer connection, the server may execute arbitrary code with the privileges of the LMDeploy serving process.

Affected context

The vulnerability occurs in LMDeploy deployments that use the PyTorch backend with PD-disaggregation or DistServe enabled. The affected control-plane flow accepts a peer address through the /distserve/p2p_connect HTTP endpoint and subsequently deserializes messages received from a ZeroMQ PULL socket using recv_pyobj(). Ordinary deployments that do not use this disaggregated-serving path may not expose the same data flow.

Exploit preconditions

  • Attack surface: The DistServe HTTP control plane and its associated ZeroMQ communication path
  • Required access: Network reachability to an affected DistServe API server; authentication may be absent unless API keys are explicitly configured
  • Trigger point: Processing a peer connection request followed by receipt of a serialized object over ZeroMQ
  • Why exploitation is possible: recv_pyobj() uses Python pickle deserialization, which can execute code during object reconstruction, and the receiving peer can be influenced through the control-plane endpoint

Why this happens

The underlying flaw is the use of Python pickle-based object deserialization for messages received from a network-influenced endpoint. Pickle is not a safe data-interchange format because object reconstruction can invoke attacker-controlled behavior. This maps to CWE-502: Deserialization of Untrusted Data, where serialized input is treated as trusted executable object state rather than being restricted to inert, validated data.

Potential impact

  • An attacker could execute arbitrary code on the serving node
  • The attacker could gain the privileges of the LMDeploy serving process
  • Model assets, prompts, credentials, or operational data could be accessed or modified
  • The serving environment could be used for lateral movement within trusted networks
  • Availability of model-serving workloads could be disrupted

General mitigation guidance

Mitigation generally focuses on removing unsafe object deserialization and reducing exposure of the DistServe control plane.

Defensive patterns include:

  • Replacing pickle-based transport with a data-only serialization format that has an explicit schema
  • Validating message types, fields, sizes, and allowed values before processing them
  • Restricting /distserve/* endpoints to trusted clients and network segments
  • Requiring API-key or equivalent authentication for control-plane requests
  • Limiting outbound ZeroMQ connections from serving nodes to approved destinations
  • Running serving processes with least privilege and isolating model-serving workloads
  • Applying network segmentation and deny-by-default firewall policies to HTTP and ZeroMQ control planes

Network restrictions and authentication reduce exposure but do not make pickle deserialization safe.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying pickle.loads, recv_pyobj(), and equivalent unsafe deserialization APIs
  • Code review checks for network-derived addresses used to establish control-plane connections
  • Inventory reviews identifying deployments with PyTorch DistServe or PD-disaggregation enabled
  • API and network policy checks confirming that /distserve/* and ZeroMQ listeners are not broadly reachable
  • Runtime monitoring for unexpected peer connections, unusual ZeroMQ destinations, or child processes spawned by serving workers
  • Automated security review tools that flag unsafe deserialization and unauthenticated administrative endpoints

Sources

SourceLink
github.comgithub.com/InternLM/lmdeploy/commit/f05b4ad8bf2e2d84101a1d63b3c44fadd99223b2
github.comgithub.com/InternLM/lmdeploy/releases/tag/v0.16.0
github.comgithub.com/InternLM/lmdeploy/security/advisories/GHSA-2vh9-42vm-xmv2

Frequently asked

questions

Yes, in affected DistServe deployments, an attacker who can reach the relevant API server may be able to trigger the vulnerable control-plane data flow remotely.

Not necessarily. API-key authentication is not enabled by default unless an operator configures it, so network reachability may be sufficient in exposed deployments.

The safest pattern is to eliminate pickle-based deserialization for network messages and replace it with a restricted, schema-validated data format. Access controls and network isolation should provide additional defense in depth.

Treat all network-received serialized data as untrusted, enforce authentication and allowlisted connectivity for control planes, and use static analysis and review policies that prohibit unsafe deserialization APIs.

Find out what's already
exploitable in your codebase.