Critical Flaw in LMCache Highlights Security Risks of Shared AI Cache Servers
A 9.8 CVSS vulnerability in LMCache exposes security risks when running shared KV caches on Kubernetes. Here is how developers can properly harden their vLLM infrastructure.

In October, security researcher Yuval Moravchick of JFrog reported a critical security vulnerability in LMCache, an open-source add-on for the vLLM inference engine. Assigned a maximum-severity CVSS score of 9.8 out of 10, the bug allowed unauthenticated attackers to execute arbitrary code as root inside the cache server container. The vulnerability affected LMCache versions 0.3.9 through 0.5.5, as well as release candidates rc1 through rc3 of version 0.5.6. The incident highlights the essential steps required to secure shared key-value (KV) caches running on Kubernetes clusters.
The mechanics behind the LMCache vulnerability
LMCache speeds up long prompt processing in vLLM setups by storing the model's KV cache—its working memory during conversations—so that the model does not need to recompute context on every request. When operating in multiprocess (MP) mode, LMCache acts as a standalone server shared across multiple vLLM pods on a GPU node. However, this architectural separation introduces network exposure risks.
The vulnerability, tracked prior to its patch in mid-October, stemmed from how the server handled incoming messages over ZeroMQ on port 5555 without authentication. The cache server decoded data using Python's pickle library, which can execute embedded instructions during unpickling. Anyone able to send a crafted message over the network could execute code as root inside the container process.
Risk was heightened because the official quick-start Kubernetes examples configured the cache DaemonSet with hostNetwork: true and set --host to 0.0.0.0. This made port 5555 accessible from any reachable network interface. Because the container also mounted the host machine's /dev/shm path, an attacker gaining container access could potentially inspect shared memory from other workloads. Additionally, administrative HTTP endpoints, such as POST /run_script on port 8080, were exposed without authentication on 0.0.0.0 prior to the 0.5.6 update.
Hardening Kubernetes cache deployments
The LMCache team resolved the immediate flaw in version 0.5.6 by replacing pickle with versioned, typed MessagePack, which carries only data. They also restricted administrative HTTP servers to 127.0.0.1 and gated POST /run_script.
However, full production hardening requires broader infrastructure changes. Kubernetes operators should move LMCache containers off the host network and onto standard pod IP addresses by setting hostNetwork: false. Moving to the pod network allows Kubernetes NetworkPolicy resources to block unauthorized cluster traffic, restricting ingress to port 5555 so only pods labeled for vLLM can connect. Enforcing these policies requires a compatible container network interface (CNI) plugin like Calico or Cilium, as basic plugins like Flannel do not natively enforce NetworkPolicy rules.
To keep vLLM traffic localized, operators can expose the cache via a Kubernetes Service configured with internalTrafficPolicy: Local. Furthermore, running the container process as an unprivileged user (runAsNonRoot: true with a designated user ID) reduces privilege escalation risks. Adopting the --isolated-ipc flag eliminates the requirement for hostPath /dev/shm mounts, helping the pod meet Kubernetes Pod Security Standards at the Baseline and Restricted levels.
What it means for developers
For engineering teams serving open-source AI models using vLLM and LMCache, this vulnerability demonstrates that shared KV caches behave much like database services such as Redis and require equivalent network isolation. Developers must plan migrations carefully because LMCache 0.5.6 introduced a breaking wire-format change that prevents components on version 0.5.5 from communicating with 0.5.6.
Because of this protocol change, standard rolling updates will cause connector errors if vLLM pods and cache servers run mismatched versions. Operators should instead utilize a blue-green deployment strategy across labeled node pools or execute a coordinated update with brief scheduled downtime. Clearing or restarting a cache server empties its in-memory state, meaning initial requests will briefly experience higher latency until the cache warms up again.
While managing private inference infrastructure demands rigorous security configuration, developers can try top AI models cheaply through one API at https://apixoai.online when prototyping applications without backend overhead.
Looking ahead, the LMCache maintainers plan to introduce native RPC authentication, a localhost-bound configuration example, and official non-root container images in version 0.5.7. Until those features ship, managing network reachability through pod network isolation remains the primary defense for production deployments.
Source: How to Secure a Shared Lmcache Server on Kubernetes — Towards AI. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

