llama.cpp fixes a critical RPC memory-write flaw and a server-hang bug — update to b12658
Two unauthenticated llama.cpp flaws: a 9.3 heap-write bug in rpc-server that can lead to code execution, and a grammar bug that hangs llama-server. Fixed in b12658.
Two newly published flaws in llama.cpp, the open-source engine many teams use to run AI models on their own hardware, can be triggered over the network without a password. The more serious one (CVE-2026-137567, CVSS 9.3) lets an attacker write into the memory of an exposed rpc-server and potentially run code; the second (CVE-2026-137057) lets anyone who can reach llama-server hang it and exhaust its memory. Update to build b12658 or later, and make sure neither service is reachable from networks you do not trust.
What happened, in plain English
llama.cpp is a free program that runs large language models (LLMs, the technology behind chatbots) on ordinary servers, workstations and laptops instead of in someone else's cloud. Many self-hosted AI setups use it directly, and a lot of other AI tools build on it.
It has two parts that matter here:
llama-serveris a small web server that answers chat and completion requests over HTTP, like a private ChatGPT endpoint.rpc-server(RPC means "remote procedure call") lets one machine borrow the graphics cards or processors of other machines, so a model too big for one computer can be split across several. The main machine sends low-level instructions such as "copy this block of data into that memory location", and the helper machine obeys.
On November 26, 2026, the GitHub Advisory Database and VulnCheck published a critical flaw in rpc-server: it did not check one kind of "copy" instruction carefully enough, so a stranger could make it write data to memory it should never touch. That can crash the service or, according to the advisory, let the attacker run their own code on the machine. No login is needed.
A day earlier, on November 25, VulnCheck published a second flaw in llama-server. Requests can include a "grammar" that forces the model's answer into a format. A grammar with an impossible rule, such as "repeat at least five times but at most two", makes a counter wrap around to a huge number, and the server loops until it hangs and runs out of memory.
Think of the RPC helper as a warehouse worker who moves boxes to any shelf number on the order slip without checking that the shelf exists.
Are you affected? What to do now
Who is affected
- CVE-2026-137567 (critical): llama.cpp builds b11450 up to, but not including, b12658, and only if you run
rpc-server(often calledggml-rpc-server) for distributed inference. If you have never started that program, this one does not apply to you. - CVE-2026-137057 (high): llama.cpp builds b7118 up to, but not including, b12604, when
llama-serveris reachable by people you do not fully trust. - Other products that bundle llama.cpp: many desktop apps, containers and wrappers ship their own copy. Whether a given product includes the vulnerable code and exposes these features has not been confirmed by those vendors; check their release notes.
- No public source reports either flaw being exploited in the wild as of November 27, 2026.
How to check
- Find your build number: run
llama-server --versionorllama-cli --version(the output includes a build number), or check the release tag of the binary or container image you downloaded. - Look for an RPC helper: on Linux,
ps aux | grep -i rpc-server; check systemd units, Docker Compose files and Kubernetes manifests forrpc-serveror a--rpcflag on the main server. - See what is listening:
ss -tlnp(Linux) ornetstat -ano(Windows). The project's example uses port 50052 for RPC; your setup may differ. Note whether it is bound to127.0.0.1(local only) or0.0.0.0(all networks). - Check your firewall, security groups and cloud load balancers for any rule that exposes those ports beyond the hosts that need them.
What to do, in order
- Update llama.cpp to b12658 or later. That build contains the RPC fix; the grammar fix shipped earlier in b12604, so b12658 covers both. Rebuild or re-pull any container images that embed llama.cpp.
- If you cannot update right away, stop
rpc-serveror firewall it so only the specific machines in your inference cluster can reach it. Never leave it on a public or shared network. - Put
llama-serverbehind authentication. Use a reverse proxy or API gateway that requires a login or key, and apply request-size and rate limits. - If an
rpc-serverwas internet-facing, treat that host as possibly compromised: review it for unexpected processes, new user accounts, outbound connections and changed files, and rotate any credentials stored on it. - For detection, watch for
rpc-servercrashes or restarts and forllama-serverprocesses whose memory climbs until they stall. No official indicators of compromise have been published.
If you only use hosted AI services, or you run llama.cpp on a laptop with nothing listening on the network, you most likely have nothing to do beyond normal updates.
The expert view
Root cause, RPC. The rpc-server protocol is deliberately low-level: clients ask for buffers, learn where they sit in memory, and issue commands that set, get and copy tensors (the arrays of numbers a model works on). Per the advisory, the bug (CWE-787, out-of-bounds write) sits in the copy-tensor path. A destination tensor with zero elements slipped past the bounds check, so a client that had first learned a buffer's base address could point the copy at memory below that buffer. In effect, the client controls where on the heap data is written. That class of bug is a well-known route to code execution, not only a crash.
The fix landed in PR #32651, shipped as build b12658 on November 24, two days before the advisory. It replaces per-command bounds checks with a single validation step on the server, rpc_check_region. The PR describes the change as a refactor and does not mention a CVE, so anyone who pins builds and reads release notes for "security" would not have spotted it.
This is the third time. The project's security page already lists a "write-what-where" bug and an arbitrary-read bug in rpc_server (August 2024), plus an unauthenticated RCE (remote code execution) through the RPC backend (March 2026). The pattern is structural. As the PR puts it, the server "validates client data separately in each handler", so every new command is a new chance to forget a check. Centralising validation is the right fix. Still, a protocol that hands out raw memory addresses to unauthenticated clients is unsafe to expose by design. The project says so plainly: the RPC README calls the feature proof-of-concept, "fragile and insecure", and warns "Never run the RPC server on an open network or in a sensitive environment!" Its SECURITY.md tells users not to use the RPC backend, rpc-server or llama-server in untrusted environments or networks.
Severity in context. The 9.3 score (CVSS 4.0: network, low complexity, no privileges or user interaction, high impact) is accurate for an exposed rpc-server. The real-world population is much smaller than llama.cpp's install base, because distributed inference is a niche feature. Where it is used, though, it tends to run on GPU (graphics processor) hosts that are attractive targets for compute theft, and such hosts sometimes sit on flat lab networks. Treat it as critical where present and irrelevant where absent.
Root cause, grammar. CVE-2026-137057 (CWE-191, integer underflow) is a missing sanity check in the grammar parser. Repetition bounds where the maximum is lower than the minimum make an unsigned counter wrap around, and the parser then generates repetition rules without end. VulnCheck scores it 8.7 under CVSS 4.0 (availability impact only); other databases list a CVSS 3.1 score of 7.5. That is fair for a single request with no login that takes down a shared inference box. There is no confidentiality or integrity impact. VulnCheck credits researcher Daniil Kuts; the fix is in b12604 (released November 21). The original bug report dates from November 18 and was public before the patch.
Broader trend. Self-hosted inference servers are deployed like internal tools but often exposed like web services, which is exactly what recent automated campaigns against exposed AI servers have exploited.
Still unknown: which downstream products bundle a vulnerable build with RPC enabled; whether working exploits for the RPC flaw are circulating (none reported by official sources); and whether the project will publish its own advisory. The GitHub entry lists affected versions as "Unknown"; the version range here comes from VulnCheck, the CVE's assigner.
Official sources
- GitHub Advisory Database: GHSA-8fqh-8p37-cc5h / CVE-2026-137567
- VulnCheck advisory: llama.cpp RPC copy-tensor out-of-bounds write (CVE-2026-137567)
- VulnCheck advisory: llama.cpp grammar parser integer underflow (CVE-2026-137057)
- llama.cpp release b12658 (RPC fix) and PR #32651
- llama.cpp release b12604 (grammar fix) and issue #32550
- llama.cpp security advisories and policy
- Coverage: ZeroHour CVE summary for CVE-2026-137057
- Related on AI Cyber Brief: Amazon: AI agents raided exposed LiteLLM, Dify and Ollama servers for API keys