Skip to content
CVE-2026-137567

llama.cpp ggml RPC Server Out-of-Bounds Write (CVE-2026-137567)

Initial Access Execution Last updated:

Detects exploitation attempts and exposure of the ggml RPC server in llama.cpp builds b11450 through b12657 (fixed in b12658), which contains an out-of-bounds write (CWE-787) in the RPC copy-tensor handler. The RPC server accepts unauthenticated connections and deserializes attacker-controlled tensor metadata. An attacker can learn buffer base addresses with BUFFER_GET_BASE, then send a COPY_TENSOR request with a zero-element destination tensor pointing below the buffer base to write to an arbitrary heap address, enabling memory corruption and potential remote code execution. Detection focuses on network exposure of the default RPC port (50052), anomalous process crashes of the rpc-server/llama-server binary, and unauthenticated inbound connections to the RPC listener.

Vulnerability Intelligence

Theoretical

What is CVE-2026-137567 llama.cpp ggml RPC Server Out-of-Bounds Write (CVE-2026-137567)?

llama.cpp ggml RPC Server Out-of-Bounds Write (CVE-2026-137567) (CVE-2026-137567) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for llama.cpp ggml RPC Server Out-of-Bounds Write (CVE-2026-137567), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution
Microsoft Sentinel / Defender
kusto
// df00tech DF00-8e571e1859 · https://df00tech.com/detections/CVE-2026-137567 · licence: https://df00tech.com/detections/licence
// Detect inbound connections to the llama.cpp ggml RPC server (default port 50052) and anomalous crashes
let rpcPorts = dynamic([50052]);
DeviceNetworkEvents
| where ActionType == "InboundConnectionAccepted"
| where LocalPort in (rpcPorts) or RemotePort in (rpcPorts)
| where InitiatingProcessFileName in~ ("rpc-server","rpc-server.exe","llama-server","llama-server.exe","ggml-rpc")
| project Timestamp, DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort, LocalIP, LocalPort, InitiatingProcessCommandLine
| join kind=leftouter (
    DeviceProcessEvents
    | where FileName in~ ("rpc-server","rpc-server.exe","llama-server","llama-server.exe")
    | where ProcessCommandLine has_any ("--rpc","-rpc","ggml-rpc")
    | project DeviceName, ProcCmd=ProcessCommandLine, ProcTime=Timestamp
) on DeviceName
| summarize ConnCount=count() by DeviceName, RemoteIP, InitiatingProcessFileName, bin(Timestamp, 5m)
| where ConnCount > 0

Surfaces inbound connections to the ggml RPC listener and correlates them with the rpc-server/llama-server process that exposes CVE-2026-137567.

high severity medium confidence

Data Sources

Microsoft Defender for Endpoint

Required Tables

DeviceNetworkEvents DeviceProcessEvents

False Positives

  • Legitimate distributed inference clusters where worker nodes intentionally run the ggml RPC server on an internal network
  • Internal benchmarking or load-testing tools connecting to the RPC port
  • Monitoring/health-check probes targeting port 50052

Query fingerprint DF00-8e571e1859 · licence

Sigma logsource & community rules

The detection logic for llama.cpp ggml RPC Server Out-of-Bounds Write (CVE-2026-137567) (CVE-2026-137567) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Expose ggml RPC server on default port (lab)

    Expected signal: Listening socket on 0.0.0.0:50052 and inbound NetworkConnection events to the rpc-server process.

  2. Test 2 Unauthenticated TCP connection to RPC listener

    Expected signal: Inbound connection-accepted event on port 50052 recorded by EDR/network sensors.

  3. Test 3 Send malformed copy-tensor-style RPC payload (lab)

    Expected signal: RPC server segfault/core dump in dmesg/syslog correlated with the inbound connection.


Response Playbook

Triage

  1. Identify the affected host and confirm the running llama.cpp build version (check `rpc-server --version` or release tag); flag any build in the range b11450 through b12657 as vulnerable.
  2. Determine whether the ggml RPC server port (default 50052) is reachable from untrusted networks by reviewing firewall rules and listening-socket inventory (`ss -ltnp | grep 50052`).
  3. Correlate the source IP(s) of inbound RPC connections against known-good distributed-inference worker/client inventory; treat any external or unexpected source as suspicious.
  4. Review process-crash, segfault, and core-dump artifacts on the host around the time of the connection for signs of successful memory corruption.

Containment

  1. Restrict access to port 50052 to trusted management/inference subnets via host and network firewall rules, or bind the RPC server to localhost only.
  2. Stop the exposed rpc-server/llama-server process if it is internet-facing and not required, pending upgrade to b12658 or later.

Evidence Collection

  1. Capture a full packet capture of traffic to port 50052 and preserve any RPC request payloads for the copy-tensor handler.
  2. Collect core dumps, process memory, and system logs (dmesg/syslog) referencing rpc-server/llama-server crashes.
  3. Preserve the llama.cpp binary and build metadata to confirm the vulnerable version.

Escalation Criteria

  • ! Escalate to incident response if a crash/core dump coincides with an external inbound RPC connection, indicating probable exploitation of the OOB write.
  • ! Escalate if follow-on activity (new child processes, outbound C2, or persistence) is observed from the host running the RPC server.

Investigation Guide

Forensic Artifacts

  • > Core dumps and segfault entries in dmesg/syslog for rpc-server/llama-server
  • > Packet captures of RPC copy-tensor requests to port 50052
  • > llama.cpp build/version metadata and release tag
  • > Listening-socket records binding port 50052

Tuning Guidance

Baseline legitimate distributed-inference worker and client IPs and exclude them from alerting, focusing on connections from outside the trusted inference subnet. Prioritize alerts that correlate inbound RPC connections with process crashes. If the RPC server is intentionally exposed, reduce severity for internal sources but keep critical alerting for external/unknown sources until all hosts are upgraded to b12658+.


Hunting Queries

Enumerate all hosts exposing or receiving traffic on the ggml RPC port 50052 to scope exposure.

Hunting — KQL
kql
// df00tech DF00-8e571e1859 · https://df00tech.com/detections/CVE-2026-137567 · licence: https://df00tech.com/detections/licence
DeviceNetworkEvents | where LocalPort == 50052 or RemotePort == 50052 | summarize by DeviceName, InitiatingProcessFileName, RemoteIP, LocalPort
Hunting — SPL
spl
``` df00tech DF00-8e571e1859 · https://df00tech.com/detections/CVE-2026-137567 · licence: https://df00tech.com/detections/licence ```
index=* (dest_port=50052 OR src_port=50052) | stats count by dest_ip src_ip dest_port

Atomic Red Team Tests

Test 1 Expose ggml RPC server on default port (lab)
linux

Start a vulnerable-range llama.cpp rpc-server bound to all interfaces to validate network-exposure detection.

Command

bash
./rpc-server -H 0.0.0.0 -p 50052 &

Cleanup

bash
pkill -f 'rpc-server' || true

Expected Telemetry

Listening socket on 0.0.0.0:50052 and inbound NetworkConnection events to the rpc-server process.

Expected Detection

KQL/SPL/CQL network rules flag inbound connections to port 50052 from the rpc-server process.

Test 2 Unauthenticated TCP connection to RPC listener
linux

Establish a raw TCP connection to the ggml RPC port to simulate unauthenticated client probing.

Command

bash
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/50052' ; echo connected

Cleanup

bash
true

Expected Telemetry

Inbound connection-accepted event on port 50052 recorded by EDR/network sensors.

Expected Detection

Network and EDR rules record an unauthenticated connection to the vulnerable RPC listener.

Test 3 Send malformed copy-tensor-style RPC payload (lab)
linux

Send an oversized/garbage payload to the RPC port to simulate a crafted copy-tensor request and induce a crash in a lab build.

Command

bash
python3 -c "import socket; s=socket.socket(); s.connect(('127.0.0.1',50052)); s.sendall(b'\xff'*4096); s.close()"

Cleanup

bash
pkill -f 'rpc-server' || true

Expected Telemetry

RPC server segfault/core dump in dmesg/syslog correlated with the inbound connection.

Expected Detection

Correlation rules flag an inbound RPC connection followed by abnormal rpc-server termination.

Related Detections

Browse by tactic

Full ATT&CK matrix Search all detections