/

CVE-2025-59953

Severity:

CRITICAL RISK

(9.8)

Unsafe Deserialization (CWE-502) in LMDeploy RPC Server

CVE-2025-59953

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

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

LMDeploy's RPC server deserializes incoming messages with Python pickle without sufficient sanitization. If an attacker can reach the RPC endpoint and send a crafted message, they may execute arbitrary code in the server process.

Affected context

The vulnerability occurs in LMDeploy deployments that enable the RPC server and expose its message-handling functionality to an untrusted or insufficiently isolated network. It affects the response-processing path when incoming RPC data is passed directly to pickle deserialization without authentication, validation, or an equivalent trust boundary.

Exploit preconditions

  • Attack surface: LMDeploy's network-accessible RPC server
  • Required access: Ability to connect to the RPC endpoint and submit messages; authentication requirements depend on deployment configuration
  • Trigger point: Processing of an incoming message in the RPC request-and-response workflow
  • Why exploitation is possible: Python pickle deserialization can invoke attacker-influenced object behavior rather than merely reconstructing inert data

Why this happens

The underlying bug is the use of pickle.loads() on received network data without establishing that the data originated from a trusted source or conforms to a safe data format. Python pickle is capable of reconstructing objects with executable behavior, so treating untrusted serialized bytes as application data creates an unsafe deserialization condition mapped to CWE-502.

Potential impact

  • An attacker may execute arbitrary code in the LMDeploy server process
  • The attacker could access model files, credentials, or other process-accessible data
  • The service may be disrupted, altered, or used to launch further attacks
  • A compromised host or container could enable lateral movement depending on runtime privileges and network access

General mitigation guidance

Mitigation generally focuses on removing executable deserialization from network-facing RPC paths and reducing exposure of the service.

Common defensive patterns include:

  • Replacing pickle-based transport with a non-executable, schema-constrained format
  • Authenticating and authorizing RPC clients before accepting messages
  • Restricting RPC listener exposure through network policies, firewalls, and private service boundaries
  • Validating message types, sizes, and fields before application processing
  • Running the server with least-privilege accounts and isolated runtime permissions
  • Treating serialized data from external or cross-trust-boundary sources as untrusted by default

How teams detect issues like this

Detection can combine source analysis, runtime monitoring, and deployment policy enforcement:

  • Use static analysis rules to flag pickle.loads, pickle.load, and related deserialization APIs on network-derived data
  • Review RPC handlers for missing authentication, authorization, schema validation, or trust-boundary checks
  • Monitor unexpected RPC clients, anomalous request volumes, and process behavior such as child-process creation
  • Enforce policies that prohibit executable serialization formats in externally reachable service interfaces
  • Use automated code-review and software-composition tools to identify unsafe deserialization patterns and exposed service configurations

Sources

SourceLink
github.comgithub.com/InternLM/lmdeploy/releases/tag/v0.10.2
github.comgithub.com/InternLM/lmdeploy/security/advisories/GHSA-5h8j-6crg-7rmw

Frequently asked

questions

Yes, when the LMDeploy RPC server is reachable by an attacker and accepts attacker-controlled messages. Exploitability depends on network exposure and access controls.

Not necessarily. The required access depends on the deployment's RPC authentication and network restrictions; an exposed endpoint without effective authorization presents the greatest risk.

Avoid deserializing untrusted data with pickle. Use a non-executable, schema-based serialization format and enforce authentication, authorization, and validation at the RPC boundary.

Treat all cross-boundary serialized data as untrusted, prohibit executable deserialization in service handlers, limit RPC exposure, and run model-serving components with least privilege.

Find out what's already
exploitable in your codebase.