on this page
CVE: CVE-2026-XXXXX (pending CERT/CC publication)
CERT/CC: VU#162455 (coordinated in login-gated VINCE #4030; Expected Date Public 2026-11-14 elapsed; CVE assignment in progress by CERT/CC) · Finding: CRUCIBLE-2026-227
Affected: ggml-org/llama.cpp (ggml-rpc backend and ggml-rpc-server / rpc-server). Runtime-tested at commits 169e4a7ff201e666c2325bcd35afb64573e39d09 and bf0040e15fd5b716262658f4d652c9cee959cf91 (RPC protocol v5.0.0) on Fedora 43 x86-64 (glibc 2.42), and source-verified still unpatched on master HEAD edec462cc00abebc50610b82ac06c6cde266e5d0 as of 2026-11-18 (ggml/src/ggml-rpc/ggml-rpc.cpp:1559-1579). No tagged release range was runtime-tested.
Bounds checks keep a reader inside its own buffer. They do not guarantee that the buffer was wiped before it was handed out. In llama.cpp's ggml-rpc server, rpc_server::get_tensor validates every read against the caller's [p0, p1) address range, keeping reads strictly in bounds. The bug happens during allocation: rpc_server::alloc_buffer obtains a backend buffer via ggml_backend_buft_alloc_buffer without zeroing it (CWE-908), and get_tensor copies from that buffer before any write occurs (CWE-200).
When two clients use the same ggml-rpc-server process one after another, that missing zeroing step crosses client sessions. Client A allocates a server-side tensor buffer through llama.cpp's documented RPC client API, writes 65,536 random bytes into it, frees it, and exits. Client B opens a separate unauthenticated TCP connection, allocates 65,536 bytes, and calls GET_TENSOR immediately without writing. On Fedora 43 x86-64 (glibc 2.42), the allocator recycled Client A's freed heap chunk and handed all 65,536 bytes straight to Client B.
Who is affected: ggml-rpc-server binds to 127.0.0.1:50052 by default and prints an explicit warning when launched on another interface. A single-user workstation running the default loopback listener only exposes this behavior to local processes on the same host. Operators who bind ggml-rpc-server to a LAN or cluster network, forward its port, or share one long-running ggml-rpc-server across separate users or jobs expose freed tensor memory across clients without protocol authentication.
Spatial bounds pass while stale bytes survive
ggml-rpc is llama.cpp's remote tensor backend for distributed inference. A coordinator connects over TCP to a ggml-rpc-server worker, allocates device or host buffers on that worker, uploads model weights or intermediate tensors, runs graph operations, and reads results back.
Safe cross-client memory handling requires two separate properties whenever a client calls GET_TENSOR:
spatial check (enforced in rpc_server::get_tensor):
p0 <= data + offset < p1 and size <= p1 - data - offset
temporal check (missing across alloc_buffer -> get_tensor):
every byte in [data + offset, data + offset + size) was either
zeroed on allocation or written by the current buffer owner
Spatial bounds checks protect neighboring allocations on the heap. Temporal initialization protects the previous occupant of the same heap chunk. When an allocator recycles a freed chunk into a new allocation [p0, p1), any bytes left behind by the earlier client now sit squarely inside the new owner's valid [p0, p1) bounds.
Bounds checks stay inside the buffer while prior client bytes stay inside the heap.
Client A writes and frees a tensor buffer through the official RPC client API. Client B connects separately, allocates the same size, and calls GET_TENSOR without writing. Compare the unpatched 64 KiB and 4 KiB observations against zeroing on allocation.
Three sequential steps inside one shared server process. Scroll horizontally on narrow screens.
Spatial bounds checks pass: every byte returned to Client B lies inside Client B's own buffer. The leak happens because alloc_buffer hands out recycled heap memory without clearing it first.
Where the server hands out uncleared memory
Allocating without clearing
When a client sends RPC_CMD_ALLOC_BUFFER, rpc_server::alloc_buffer in ggml/src/ggml-rpc/ggml-rpc.cpp checks the device index, requests a buffer of request.size bytes from the backend buffer type, and inserts the resulting pointer into the connection's buffers set:
// ggml/src/ggml-rpc/ggml-rpc.cpp (runtime-tested at 169e4a7 and bf0040e;
// unpatched on master edec462 at lines 1559-1579)
bool rpc_server::alloc_buffer(
const rpc_msg_alloc_buffer_req & request,
rpc_msg_alloc_buffer_rsp & response) {
uint32_t dev_id = request.device;
if (dev_id >= backends.size()) {
return false;
}
ggml_backend_buffer_type_t buft =
ggml_backend_get_default_buffer_type(backends[dev_id]);
ggml_backend_buffer_t buffer =
ggml_backend_buft_alloc_buffer(buft, request.size);
response.remote_ptr = 0;
response.remote_size = 0;
if (buffer != nullptr) {
// Missing: ggml_backend_buffer_clear(buffer, 0);
response.remote_ptr = reinterpret_cast<uint64_t>(buffer);
response.remote_size = buffer->size;
buffers.insert(buffer);
}
return true;
}
On the CPU backend, ggml_backend_buft_alloc_buffer ultimately obtains aligned heap memory from the system allocator without zero-filling it. When an earlier client calls FREE_BUFFER, rpc_server::free_buffer verifies handle ownership, calls ggml_backend_buffer_free(buffer), and removes the handle from buffers. Neither free nor subsequent allocation clears the underlying bytes (CWE-908: Use of Uninitialized Resource).
Checking bounds without checking initialization
Client B never reuses Client A's old buffer pointer. Client B uses the fresh remote_ptr and base address returned for Client B's own allocation, constructs a matching 1D tensor descriptor, and sends RPC_CMD_GET_TENSOR before sending any write command.
Inside rpc_server::get_tensor, the server deserializes the tensor header, confirms tensor->buffer belongs to the caller's active buffers set, and checks the requested slice against [p0, p1):
// ggml/src/ggml-rpc/ggml-rpc.cpp (rpc_server::get_tensor)
const size_t p0 = (size_t) ggml_backend_buffer_get_base(tensor->buffer);
const size_t p1 = p0 + ggml_backend_buffer_get_size(tensor->buffer);
if (request.tensor.data + request.offset < p0 ||
request.tensor.data + request.offset >= p1 ||
request.size > (p1 - request.tensor.data - request.offset)) {
return false;
}
response.resize(request.size, 0);
ggml_backend_tensor_get(tensor, response.data(), request.offset, request.size);
return true;
Look at the final three lines. response.resize(request.size, 0) zero-initializes the outgoing std::vector<uint8_t> on the C++ side, then ggml_backend_tensor_get immediately overwrites response.data() with request.size bytes copied out of tensor->buffer. Because tensor->buffer was never cleared, get_tensor copies the prior client's leftover bytes into the reply (CWE-200: Exposure of Sensitive Information).
(Source verification note: runtime-tested at 169e4a7ff201e666c2325bcd35afb64573e39d09 and bf0040e15fd5b716262658f4d652c9cee959cf91, re-checked at 8e53fcefd2c01ff70434ab41866bfc2eca31fe90 on 2026-08-31, and verified still unpatched on master HEAD edec462cc00abebc50610b82ac06c6cde266e5d0 as of 2026-11-18 at ggml/src/ggml-rpc/ggml-rpc.cpp:1559-1579.)
Two-process cross-client experiment and controls
To verify that ordinary client usage leaves recoverable data behind, we tested a stock ggml-rpc-server binary on Fedora Linux 43 x86-64 (glibc 2.42, PIE, full RELRO, NX, and kernel ASLR randomize_va_space = 2 all active) listening on 127.0.0.1:50052. Client A (victim227) and Client B (attacker227) ran as separate operating-system processes and shared no files.
Full 64 KiB recovery across separate processes
- Client A (
victim227, legitimate RPC client): Connects throughllama.cpp's official client API (ggml_backend_rpc_buffer_type->ggml_backend_alloc_ctx_tensors_from_buft->ggml_backend_tensor_set). It reads65,536fresh random bytes from/dev/urandom, stamps the 17-byte ASCII prefix"VICTIM-SECRET-227"at byte0, writes the tensor to the RPC server, frees the buffer viaggml_backend_buffer_free, and exits. - Client B (
attacker227, unauthenticated reader): Opens a new TCP connection to127.0.0.1:50052, completesHELLO, callsALLOC_BUFFER(65536)andGET_ALLOC_BASE, and sendsGET_TENSORacross[0, 65536)without issuing anySET_TENSORwrite. - External comparison: Comparing Client A's saved random input against Client B's recovered output outside both processes showed an exact
65,536-byte match:
exact match : true
leading bytes equal : 65536 of 65536
clearing control ran: true
cleared discloses : false
cleared non-zero : 0
In the original two-process witness at 169e4a7, both Client A's generated secret and Client B's recovered file hashed to the exact same SHA-256 digest (6cca39b82beac9c1fbd1db4c8c7203edd528d9eebe6b7e3e0abe3ebacd829b4f). An independent replay through Crucible's RPC sequence oracle on a clean 169e4a7 build reproduced the full 65,536-byte match (459b3e475a7d3fd09419f4cff9ffeca85f82246d31725cf728cbc371b30fe1bd, with 65,266 non-zero random bytes), and a clean replay at bf0040e reproduced the same byte-for-byte recovery.
Partial 4 KiB recovery and glibc allocator metadata
We also tested a 4,096-byte (128 chunks of 32 bytes, or 512 8-byte qwords) allocation on the same Fedora 43 glibc 2.42 host. Client B recovered 118 of 128 32-byte chunks (508 of 512 qwords).
The remaining four qwords at byte offsets 0, 8, 16, and 24 had been overwritten by glibc free-list bookkeeping when Client A freed the chunk. Offset 8 held a pointer into libc's writable .data segment (main_arena) at a constant offset of 0x1ea140 from the randomized libc base across 6 consecutive ASLR server restarts. Running five intermediate alloc/free churn cycles between Client A and Client B did not clear the residual payload or the arena pointer.
Two precision bounds apply to this observation:
- Only two sizes (
4,096bytes and65,536bytes) were tested; they are concrete measurements onglibc 2.42rather than a general rule across allocation sizes. - The
0x1ea140arena offset revealslibcbase only if the target's exactglibcbuild is already known (a differentglibcbuild shifts that offset), and it does not reveal the mainggml-rpc-serverPIE base.
Negative control and platform dependence
To confirm that the bytes came strictly from uncleared allocation storage rather than reply-framing confusion, attacker227 --clear sends RPC_CMD_BUFFER_CLEAR (BUFFER_CLEAR(0)) immediately after ALLOC_BUFFER and before GET_TENSOR. With that single command added, the 4,096-byte test returned 512 of 512 zero qwords (0 victim markers and 0 pointers), and the 65,536-byte test returned 65,536 zero bytes.
Observable reuse also depends on the underlying operating system, backend, and allocator. A separate test on macOS arm64 at a different commit returned zeroed memory, confirming that the source bug (alloc_buffer skipping initialization) only produces an observable cross-client leak when the backing allocator hands back non-zeroed pages or bins.
(Reproducibility digests: stock 169e4a7 server binaries a38755b85ebf6edfab47938b474957e893a3f7c30d8f8c7f9e7b798de6a38e32 and c5152075f655ebb9ad7d51f7dede220e6a088049558bcda4d9de37596f8bb617; stock bf0040e server binary 6ea32549c90b8b7af62885eaadec77f36b4905e0b00b3af2e3df12c9974e2c34; Fedora 43 glibc-2.42-13.fc43.x86_64 72e64de106dd417510a2e23a9168edd46868f7cf80abdd6913378ab6c2b2845b.)
Default loopback posture and scope boundaries
llama.cpp already warns operators that ggml-rpc is experimental and untrusted-network-hostile. In tools/rpc/rpc-server.cpp, the server defaults params.host to "127.0.0.1" on port 50052 and prints a loud banner whenever an operator binds a non-loopback address:
// tools/rpc/rpc-server.cpp
if (params.host != "127.0.0.1") {
fprintf(stderr, "WARNING: Host ('%s') is != '127.0.0.1'\n", params.host.c_str());
fprintf(stderr, " Never expose the RPC server to an open network!\n");
fprintf(stderr, " This is an experimental feature and is not secure!\n");
}
llama.cpp's SECURITY.md likewise advises against exposing the RPC backend to untrusted networks and places multi-tenant isolation on the deployer. That context bounds what VU#162455 is and is not:
- Conditional reachability: Under the default
127.0.0.1:50052binding, an attacker needs local TCP reachability on the server host. The proposed CVSS v3.1 vector (7.5 High,AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) applies only when an operator exposesggml-rpc-serverover a network or forwarding path, since the wire protocol has no authentication. - Synthetic test data only: Our experiments wrote
/dev/urandombytes tagged"VICTIM-SECRET-227". While distributed inference workloads store model weights, activations, or KV-cache tensors in RPC buffers, we did not test against or recover any real user prompt, model checkpoint, or production workload. - Standalone confidentiality scope:
VU#162455(CRUCIBLE-2026-227) establishes cross-client confidentiality loss only. It does not modify another client's active buffers, crash the server, or achieve code execution, and it should not be conflated with the separateggml-rpccustom-operator indirect-call advisory (CVE-2026-78147).
Clearing buffers before returning the handle
The server already implements a backend-agnostic zeroing helper in rpc_server::buffer_clear: ggml_backend_buffer_clear(buffer, value). Calling that helper once inside rpc_server::alloc_buffer before publishing the handle closes the uninitialized-read window using the exact mechanism validated by our BUFFER_CLEAR(0) negative control:
--- a/ggml/src/ggml-rpc/ggml-rpc.cpp
+++ b/ggml/src/ggml-rpc/ggml-rpc.cpp
@@ bool rpc_server::alloc_buffer(...)
response.remote_ptr = 0;
response.remote_size = 0;
if (buffer != nullptr) {
+ ggml_backend_buffer_clear(buffer, 0);
response.remote_ptr = reinterpret_cast<uint64_t>(buffer);
response.remote_size = buffer->size;
LOG_DBG("[%s] device: %d, size: %" PRIu64 " -> remote_ptr: %" PRIx64 ", remote_size: %" PRIu64 "\n",
__func__, dev_id, request.size, response.remote_ptr, response.remote_size);
buffers.insert(buffer);
}
This diff is our proposed fix; upstream llama.cpp has not merged a patch as of 2026-11-18. Before adopting eager zeroing across every device backend, maintainers should verify stream ordering and clear cost on CUDA, Metal, Vulkan, and SYCL backends (an alternative design tracks initialized byte intervals per buffer and rejects get_tensor reads overlapping unwritten ranges, at the cost of extra state across views and copies).
For teams running ggml-rpc-server today:
- Keep listeners on loopback or isolated point-to-point tunnels: Leave
ggml-rpc-serveron127.0.0.1, or bind it strictly inside a mutually authenticated WireGuard or private single-job network namespace rather than a shared LAN or cluster subnet. - Never share one
ggml-rpc-serveracross untrusted tenants: Treat eachggml-rpc-serverprocess as dedicated to a single security principal, and terminate worker processes between separate jobs until server-side allocations are cleared before handles are returned.
Disclosure timeline
- 2026-08-19: Reported
CRUCIBLE-2026-227to CERT/CC via VINCE (VRF#26-08-BKMQH, opened as CERT/CC VU#162455 in VINCE#4030), asggml-org/llama.cpphad disabled GitHub Private Vulnerability Reporting inSECURITY.md. - 2026-08-31: Submitted supporting technical report, portable two-process C++ reproduction (
victim227andattacker227),BUFFER_CLEAR(0)negative-control receipts, and proposedggml_backend_buffer_clear(buffer, 0)patch to CERT/CC in VINCE#4030. - 2026-11-14: CERT/CC Expected Date Public (
2026-11-14) elapsed. - 2026-11-18: Verified
ggml/src/ggml-rpc/ggml-rpc.cpp:1559-1579remains unpatched onggml-org/llama.cppmaster(HEADedec462cc00abebc50610b82ac06c6cde266e5d0) and published this technical advisory in coordination with CERT/CC while CVE assignment under VU#162455 completes.