Summary
CVE-2025-66455 is a critical remote code execution vulnerability in LMDeploy, an open-source LLM inference and serving toolkit maintained by InternLM. The flaw stems from unsafe pickle deserialization in the PyTorch DistServe control plane, where messages received over a ZeroMQ socket are deserialized without validation. An unauthenticated attacker who can reach the exposed /distserve/p2p_connect HTTP endpoint can trigger arbitrary code execution on the server, earning the flaw a CVSS v3.1 base score of 9.8 (Critical).
Technical details
- Root cause: The
EngineP2PConnection.handle_zmq_recv()handler (inlmdeploy/pytorch/disagg/conn/engine_conn.py) uses PyZMQ’srecv_pyobj(), which internally calls Python’spickle.loads()on data received from a ZeroMQ PULL socket, without sanitizing or validating the payload before deserialization (CWE-502: Deserialization of Untrusted Data). - Trigger conditions: An attacker sends a request to the
POST /distserve/p2p_connectendpoint, supplying an attacker-controlledremote_engine_endpoint_info.zmq_address. This causes the LMDeploy server to connect to the attacker’s ZeroMQ endpoint and deserialize a malicious pickle payload sent back, resulting in code execution. - Attack vector: Network-based, no authentication or user interaction required. The advisory notes that API-key authentication is not enabled by default and must be explicitly configured by the operator, meaning many deployments expose this endpoint without any access control.
- Impact: Full compromise of confidentiality, integrity, and availability of the affected LMDeploy server, including arbitrary code execution in the context of the serving process — which may run with access to model weights, inference infrastructure, and any connected internal network resources.
Affected software
- LMDeploy versions >= 0.9.2 and < 0.16.0 (i.e., 0.9.2 through 0.15.x)
- Fixed in LMDeploy 0.16.0
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CWE-502: Deserialization of Untrusted Data
Mitigation and recommended actions
- Immediate: Upgrade LMDeploy to version 0.16.0 or later, which replaces the unsafe pickle-based
send_pyobj()/recv_pyobj()calls with JSON serialization (send_json()/recv_json()) and Pydantic schema validation on the DistServe control plane. - If immediate patching is not possible:
- Explicitly enable API-key authentication on LMDeploy serving endpoints, since it is not on by default.
- Restrict network access to
/distserve/*endpoints and any associated ZeroMQ control-plane ports to trusted hosts only (e.g., via firewall rules or network segmentation). - Do not expose LMDeploy DistServe endpoints directly to the public internet; place them behind a trusted internal network or VPN.
- Block outbound connections from LMDeploy serving nodes to untrusted or attacker-influenceable ZeroMQ addresses where feasible.

