A llama.cpp Cleanup Patch Closed a 9.8-Rated Heap Write in Its RPC Server Days Before the CVE Went Public

CVE-2026-137567, published on November 26, 2026, lets an unauthenticated client write below a buffer's base address in llama.cpp's ggml RPC server. Builds b11450 through b12657 and v1.0.0 are affected. The fix shipped in b12658 on November 24 as part of a broader rewrite of how the server validates requests.

A row of plain server cabinets in a quiet violet data room, with one cable glowing coral where it sits just below its proper socket.
A row of plain server cabinets in a quiet violet data room, with one cable glowing coral where it sits just below its proper socket.

llama.cpp’s RPC server, the component that lets one machine borrow GPUs or CPUs on other machines for inference, has a critical memory-safety bug that an attacker can trigger without logging in. CVE-2026-137567 was published on November 26, 2026 with a CVSS 3.1 score of 9.8. By then the fix had already shipped two days earlier, inside a pull request that described itself as a cleanup of the server’s message handling.

The vulnerability record was assigned and scored by VulnCheck, which also gives it a CVSS 4.0 score of 9.3 and classifies it as CWE-787, an out-of-bounds write. The National Vulnerability Database published it on November 26, and GitHub’s advisory database carries it as GHSA-8fqh-8p37-cc5h, still marked unreviewed. VulnCheck credits the discovery to Min P. Hong of SEWORKS.

One bounds check, one direction

The bug sits in rpc_server::copy_tensor in ggml/src/ggml-rpc/ggml-rpc.cpp. That handler serves RPC_CMD_COPY_TENSOR, which tells a remote server to copy one tensor’s data into another. Before the copy, the vulnerable code checked whether the destination address plus the source tensor’s size ran past the end of the destination buffer. It did not check whether the destination address started before the beginning of that buffer.

The advisory describes how an attacker uses that gap. A client first calls BUFFER_GET_BASE to learn where a buffer sits in the server’s memory. It then sends a copy request with a destination tensor that has zero elements and a data pointer below that base. The upper-bound check passes, and the server writes attacker-supplied data to heap addresses outside any buffer it allocated. VulnCheck says the result can be a crash or code execution. No authentication is needed, only network access to the server’s TCP port.

The advisory lists builds from b11450 up to, but not including, b12658 as affected. Build b11450 was released on October 6 and added -sm tensor support to the RPC backend. That change also bumped the RPC protocol’s major version. GitHub’s compare view shows that the v1.0.0 release from November 13 falls inside that range and lacks the fix. The v1.1.0 release from November 26 includes it.

The patch was not filed as a security fix

The fix is commit 03813c5, from pull request #32651 by contributor Aman Gupta. It was opened on November 20, merged on November 23 and it shipped in build b12658 early on November 24 UTC. The pull request is titled “rpc : typed request helpers and a single validation step on the server”. It does not mention a vulnerability.

Instead, it changes how the RPC code builds and checks messages. Each fixed-size command now maps to typed request and response structures through one table, so passing the wrong structure for a command no longer compiles. A helper called rpc_check_region replaces the bounds checks that used to be written separately in each handler. Tensor deserialization now rejects malformed values before a tensor is created. Graph computation is rebuilt in a single pass that rejects unknown or duplicate IDs and views that point outside their source buffer. The description also lists six other open hardening pull requests that tried to add the same checks one by one. The author answered “YES, paired with Claude” in the project’s AI-usage disclosure field.

A repeat target

This is not the first critical bug in the same component. In March 2026 the project published GHSA-j8rj-fmpv-wcxw (CVE-2026-34159), rated critical. In that bug, a tensor with its buffer field set to zero skipped validation during GRAPH_COMPUTE. Combined with pointer leaks from ALLOC_BUFFER and BUFFER_GET_BASE, it gave an attacker arbitrary read and write and remote code execution.

The project’s own documentation has long warned about this. The RPC README says the example and the backend “are currently in a proof-of-concept development stage” and that the functionality “is fragile and insecure,” and it tells users to never run the RPC server “on an open network or in a sensitive environment.” By default, ggml-rpc-server binds to 127.0.0.1 on port 50052 and prints a warning when started on any other host address. But the README’s own multi-machine example points llama-cli at servers on LAN addresses. Spreading a model across several machines on a network is the reason the feature exists.

Who needs to act

Only machines running ggml-rpc-server are exposed. According to the README, that listener is a separate binary, built with -DGGML_RPC=ON and started on each remote host. The main host’s llama-cli or llama-server connects to it through the --rpc option. Operators who use the RPC backend should move to b12658 or later, or to v1.1.0. Until they can upgrade, they should keep the server off the internet and off any network shared with untrusted hosts. The fixed build also includes the other checks from the same pull request, such as rejecting malformed tensors before they are created.

Topics
  • #llama.cpp
  • #ggml
  • #CVE-2026-137567
  • #Vulnerabilities
  • #Local Inference
Raj M

Author

Raj M

Contributor

AI Systems Architect is a seasoned technology leader with over 15 years of experience in the IT industry working with Fortune 500 companies. With a solid foundation in multi-agent systems, open-source LLM infrastructure, and enterprise deployment, he excels at building scalable production-grade AI platforms.