# CVE-2026-76850: LMDeploy Remote Code Execution via Unsafe Pickle Deserialization in the Disaggregated Serving Peer Connector

The Markdown version of <https://upatch.dev/cve/CVE-2026-76850>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-76850 is rated Critical 9.3 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects LMDeploy (InternLM) and was published on 19 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 1.3%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-76850-exec-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

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.

## What the upatch does

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.

The policy: [`cve-2026-76850-exec-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-76850), 94 lines of BPF C attached at `lsm/bprm_check_security`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- The `lmdeploy-srv` Python server process and its forked child processes cannot execute external binaries via `execve`. 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-srv` process that relies on `subprocess` or `os.system` will fail with `PermissionError` (`EPERM`).
- Processes whose command name is not `lmdeploy-srv` are 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.

## 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   |

## How it was tested

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

### Results

| State           | P2P ZMQ recv_pyobj() subprocess execution |
| --------------- | ----------------------------------------- |
| Before loading  | reached                                   |
| Upatch loaded   | blocked                                   |
| After unloading | reached                                   |

## How to apply

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.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-76850
```

Publish and roll out:

```sh
shirudo 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>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-76850 record](https://cveawg.mitre.org/api/cve/CVE-2026-76850)
- [VulnCheck advisory](https://www.vulncheck.com/advisories/lmdeploy-remote-code-execution-via-unsafe-pickle-deserialization-in-the-disaggregated-serving-peer-connector)
- [GitHub issue #4804](https://github.com/InternLM/lmdeploy/issues/4804)
- [Fix commit f05b4ad8bf2e2d84101a1d63b3c44fadd99223b2](https://github.com/InternLM/lmdeploy/commit/f05b4ad8bf2e2d84101a1d63b3c44fadd99223b2)
- [LMDeploy v0.15.0 engine_conn.py](https://github.com/InternLM/lmdeploy/blob/v0.15.0/lmdeploy/pytorch/disagg/conn/engine_conn.py#L61)
- [LMDeploy v0.16.0 release](https://github.com/InternLM/lmdeploy/releases/tag/v0.16.0)

### Links

- [CVE-2026-76850 on upatch.dev](https://upatch.dev/cve/CVE-2026-76850) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-76850)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-76850)
- [CWE-502](https://cwe.mitre.org/data/definitions/502.html)
- Upatch source: [upatches/cve-2026-76850](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-76850)

### More references from NVD (7)

- [github.com](https://github.com/InternLM/lmdeploy)
- [github.com](https://github.com/InternLM/lmdeploy/blob/v0.15.0/lmdeploy/pytorch/disagg/conn/engine_conn.py#L61)
- [github.com](https://github.com/InternLM/lmdeploy/blob/v0.15.0/lmdeploy/pytorch/disagg/conn/engine_conn.py#L79)
- [github.com](https://github.com/InternLM/lmdeploy/commit/f05b4ad8bf2e2d84101a1d63b3c44fadd99223b2)
- [github.com](https://github.com/InternLM/lmdeploy/issues/4804)
- [github.com](https://github.com/InternLM/lmdeploy/releases/tag/v0.16.0)
- [vulncheck.com](https://www.vulncheck.com/advisories/lmdeploy-remote-code-execution-via-unsafe-pickle-deserialization-in-the-disaggregated-serving-peer-connector)
