CVE-2026-76850
LMDeploy Remote Code Execution via Unsafe Pickle Deserialization in the Disaggregated Serving Peer Connector
Refuses subprocess execution by the LMDeploy server process to mitigate CVE-2026-76850.
Critical 9.3Vetted
EPSS 1.3%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.
At a glance
CVE-2026-76850 is a critical (CVSS 9.3) vulnerability in LMDeploy, published 19 August 2026. A vetted upatch, cve-2026-76850-exec-block, blocks it on running Linux machines with shirudo until LMDeploy is upgraded.
- Severity
- Critical 9.3 CVSS 4.0
- Chance of exploitation
- 1.3% in the next 30 days (EPSS, 24 Nov 2026)
- Known exploited
- No, not on CISA’s KEV list
- Weakness
- CWE-502
- Affected software
- LMDeploy (InternLM)
- Upatch status
- Vetted, merged into the registry
- How to apply
- Build, sign and roll out with shirudo
Overview
CVE-2026-76850 is an unsafe deserialization vulnerability (CWE-502) in LMDeploy 0.9.2 through 0.15.0. In lmdeploy/pytorch/disagg/conn/engine_conn.py, EngineP2PConnection.handle_zmq_recv receives peer-to-peer cache-free requests over a ZeroMQ PULL socket by calling recv_pyobj(), which deserializes the incoming bytes with pickle.loads() before checking isinstance(req, DistServeCacheFreeRequest). The peer address is controlled by the caller: EngineP2PConnection.p2p_connect passes conn_request.remote_engine_endpoint_info.zmq_address directly to connect() on the ZeroMQ PULL socket, and the POST /distserve/p2p_initialize and POST /distserve/p2p_connect routes in lmdeploy/serve/openai/api_server.py require no authentication unless api_keys is configured. A remote caller can instruct the server to connect its PULL socket to an arbitrary TCP endpoint and send a crafted pickle stream to execute commands on the host.
Official description
LMDeploy deserializes disaggregated-serving peer messages with pickle. The handle_zmq_recv coroutine in lmdeploy/pytorch/disagg/conn/engine_conn.py reads peer-to-peer cache-free requests with recv_pyobj(), which deserializes the received bytes with pickle.loads(), and the isinstance check against DistServeCacheFreeRequest runs only after deserialization has already completed. The peer that supplies those bytes is caller-controlled: p2p_connect passes remote_engine_endpoint_info.zmq_address from the request body to connect() on the ZMQ PULL socket, and the POST /distserve/p2p_initialize and /distserve/p2p_connect endpoints in lmdeploy/serve/openai/api_server.py apply no authentication unless the server is started with api_keys, which defaults to None. A remote attacker can direct an engine to pull from a ZMQ endpoint under their control and execute arbitrary code in the engine process. Deployments that do not enable disaggregated serving are not affected, because the receive loop is only started once the migration backend accepts the connection.
Affected versions
The upatch targets Linux kernels with BPF LSM and BTF enabled, including Linux 7.4.
LMDeploy versions:
| Package | Affected | Fixed in |
|---|---|---|
lmdeploy |
0.9.2 to 0.15.0 | 0.16.0 |
Sources
More references from NVD (7)
Mitigation
The BPF LSM program cve_2026_76850_exec_block attaches to lsm/bprm_check_security and returns -EPERM when the calling process has a python* executable and its task, thread-group leader, or parent task has the command name lmdeploy-srv. When an earlier BPF LSM program on the same hook has already returned an error, that verdict is preserved.
Refusals are counted in the refused per-CPU array map at key 0.
Side effects
- The
lmdeploy-srvPython server process and its forked child processes cannot execute external binaries viaexecve. Normal disaggregated-serving peer messages (DistServeCacheFreeRequest) and inference requests run inside the Python process and do not spawn external binaries. - Any administrative hook or custom plugin running inside the
lmdeploy-srvprocess that relies onsubprocessoros.systemwill fail withPermissionError(EPERM). - Processes whose command name is not
lmdeploy-srvare unaffected.
Preemption model and cost
The program holds no locks and shares only the per-CPU refused counter, updated with __sync_fetch_and_add, making it safe under all kernel preemption models including PREEMPT_LAZY, PREEMPT_DYNAMIC, and PREEMPT_RT. Each execve on the machine checks the current task's executable prefix (python) first and returns immediately for non-Python processes.
The policy
94 lines of BPF C, attached at lsm/bprm_check_security.
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_core_read.h>
#define EPERM 1
char _license[] SEC("license") = "Dual BSD/GPL";
struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__type(key, __u32);
__type(value, __u64);
} refused SEC(".maps");
static __always_inline void count_refused(void)
{
__u32 key = 0;
__u64 *value = bpf_map_lookup_elem(&refused, &key);
if (value)
__sync_fetch_and_add(value, 1);
}
static __always_inline int earlier_verdict(int ret)
{
return ret >= -4095 && ret < 0 ? ret : -EPERM;
}
static __always_inline bool comm_is_lmdeploy(const struct task_struct *task)
{
char comm[16] = {};
if (!task)
return false;
if (bpf_probe_read_kernel(comm, sizeof(comm), &task->comm))
return false;
return comm[0] == 'l' && comm[1] == 'm' && comm[2] == 'd' &&
comm[3] == 'e' && comm[4] == 'p' && comm[5] == 'l' &&
comm[6] == 'o' && comm[7] == 'y' && comm[8] == '-' &&
comm[9] == 's' && comm[10] == 'r' && comm[11] == 'v' &&
comm[12] == 0;
}
static __always_inline bool exe_is_python(const struct task_struct *task)
{
const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
const unsigned char *name = BPF_CORE_READ(exe, d_name.name);
__u32 len = BPF_CORE_READ(exe, d_name.len);
char buf[7] = {};
if (!name || len < 6)
return false;
if (bpf_probe_read_kernel(buf, 6, name))
return false;
return buf[0] == 'p' && buf[1] == 'y' && buf[2] == 't' &&
buf[3] == 'h' && buf[4] == 'o' && buf[5] == 'n';
}
static __always_inline bool is_lmdeploy_task(void)
{
struct task_struct *task = bpf_get_current_task_btf();
struct task_struct *parent;
struct task_struct *leader;
struct task_struct *parent_leader;
if (!exe_is_python(task))
return false;
if (comm_is_lmdeploy(task))
return true;
leader = BPF_CORE_READ(task, group_leader);
if (comm_is_lmdeploy(leader))
return true;
parent = BPF_CORE_READ(task, real_parent);
if (comm_is_lmdeploy(parent))
return true;
parent_leader = BPF_CORE_READ(parent, group_leader);
return comm_is_lmdeploy(parent_leader);
}
SEC("lsm/bprm_check_security")
int BPF_PROG(cve_2026_76850_exec_block, struct linux_binprm *bprm, int ret)
{
if (ret)
return earlier_verdict(ret);
if (!is_lmdeploy_task())
return 0;
count_refused();
return -EPERM;
}
The package: name, license, the program and the CVE it fixes.
[package]
name = "cve-2026-76850"
description = "Refuses subprocess execution by the LMDeploy server process to mitigate CVE-2026-76850"
license = "GPL-2.0 OR BSD-2-Clause"
[[upatches]]
source = "cve-2026-76850-exec-block.bpf.c"
[upatches.tree]
id = "cve-2026-76850-exec-block"
fixes = ["CVE-2026-76850"]
Process
How this upatch was written, checked and reviewed, from the registry’s history.
- 19 Aug 2026CVECVE published
- 25 Nov 2026Pull requestPull request #30 openedAdd CVE-2026-76850: Refuses subprocess execution by the LMDeploy server processromanlab
- 25 Nov 2026MergeMerged #30romanlab
- 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
No human review is recorded on GitHub for this upatch yet.
Evidence
On LMDeploy 0.15.0 running the disaggregated-serving peer connector on loopback, the loaded upatch refused subprocess execution by lmdeploy-srv with EPERM while before and after runs reached /bin/true after recv_pyobj() deserialization.
- Tested
- 25 Nov 2026
- Target
- LMDeploy 0.15.0 disaggregated-serving peer connector (EngineP2PConnection and /distserve/p2p_connect), Python 3.12, loopback only
- Kernel
- 7.4-shirudo-ci-20261123
- Architecture
- x86_64
- Distribution
- Ubuntu 26.04
| State | P2P ZMQ recv_pyobj() subprocess execution |
|---|---|
| Before loading | reached |
| Upatch loaded | blocked |
| After unloading | reached |
tools-test.log Output of tools/test --setup showing the payload reached before, blocked while the upatch was loaded, and reached again after unload.
tools/test --setup, 2026-11-25T11:21:00Z Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm cve-2026-76850 setup done LMDEPLOY_URL=http://127.0.0.1:23333 LMDEPLOY_PYTHON=/opt/upatch-payload/cve-2026-76850/venv/bin/python LMDEPLOY_SRC=/opt/upatch-payload/cve-2026-76850/lmdeploy-0.15.0 LMDEPLOY_STATE=/opt/upatch-payload/cve-2026-76850/probe.state before reached LMDeploy deserialized the P2P ZMQ message with recv_pyobj() and executed /bin/true loaded blocked the upatch refused subprocess execution by lmdeploy-srv with EPERM after reached LMDeploy deserialized the P2P ZMQ message with recv_pyobj() and executed /bin/true PASS: reached before, blocked while loaded, reached again after
Use it
Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-76850shirudo bpm push build/packages/cve-2026-76850-1.0.0.bee oci://<registry>/<namespace>/cve-2026-76850 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-76850-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>