Back to Intelligence

CVE-2026-137567: Critical llama.cpp ggml RPC Server RCE — Detection and Remediation Guide

SA
Security Arsenal Team
November 28, 2026
11 min read

On the heels of NVD publishing CVE-2026-137567, any organization running llama.cpp's distributed inference infrastructure needs to stop and take inventory. This is a CVSS 9.8 (Critical), network-exploitable, unauthenticated out-of-bounds write in the ggml RPC server — the component llama.cpp uses to distribute tensor computation across remote worker nodes. Affected builds span b11450 up to (but not including) b12658. An attacker who can reach the RPC port can learn the base address of internal buffers via the BUFFER_GET_BASE command, then send a crafted RPC_CMD_COPY_TENSOR message with a destination pointer below that base — giving them an arbitrary heap write primitive. That means remote code execution or, at minimum, a reliable server crash, with zero authentication required.

If your environment uses llama.cpp in distributed mode — common in homelab clusters, research environments, inference farms, and increasingly in production AI pipelines that shard models across GPU nodes — you are potentially one unauthenticated packet away from full host compromise on every RPC worker. This is exactly the class of vulnerability that turns an internal AI tooling box into a beachhead for lateral movement.

Technical Analysis

Affected Products and Versions

  • Product: llama.cpp (specifically the ggml RPC server component, typically deployed as rpc-server)
  • Affected builds: b11450 through builds prior to b12658
  • Fixed in: build b12658 and later
  • Platforms: All platforms where the RPC server is deployed (Linux is the dominant deployment model for GPU inference clusters, but the component is cross-platform)

Vulnerability Details

AttributeValue
CVECVE-2026-137567
CVSS v3.x Score9.8 (Critical)
Attack VectorNetwork
Authentication RequiredNone
Vulnerability ClassOut-of-bounds write (CWE-787)
Componentggml RPC server

How the Attack Works (Defender's View)

The ggml RPC protocol is a simple command-based protocol used to offload tensor operations (allocate, compute, copy) to remote worker nodes. It was designed for trusted, low-latency internal networks and ships with no authentication layer by default.

The exploitation chain works as follows:

  1. Address disclosure: The attacker sends a legitimate BUFFER_GET_BASE RPC command, which returns the base address of a heap-allocated tensor buffer. This defeats ASLR for the purposes of the attack — the attacker now knows a live heap pointer on the target.
  2. Arbitrary write primitive: The attacker then sends RPC_CMD_COPY_TENSOR with a zero-element destination tensor whose destination pointer is set to an address below the buffer base. Because the server fails to validate that the destination lies within the bounds of the allocated buffer (a zero-element tensor bypasses size checks while the pointer arithmetic underflows), the copy operation writes attacker-controlled data to an arbitrary heap address.
  3. Impact: The attacker can corrupt adjacent heap structures to crash the daemon (denial of service against inference capacity) or overwrite function pointers/return addresses to achieve code execution in the context of the rpc-server process — typically a service account with GPU and filesystem access on the worker node.

The critical defensive insight here: this protocol was never meant to face untrusted networks. Every RPC command in the ggml protocol is essentially a remote memory-management operation. CVE-2026-137567 is a sharp reminder that the entire attack surface of the RPC server should be treated as hostile-input handling.

Exploitation Status

At the time of this writing, CVE-2026-137567 is newly published by NVD and has not yet been added to the CISA Known Exploited Vulnerabilities catalog. However, the vulnerability requires no authentication, the exploit path is fully documented in the public advisory, and llama.cpp is among the most widely deployed open-source inference runtimes in the world. Treat exploitation as imminent: internet-facing or broadly network-accessible rpc-server instances should be considered at immediate risk. Shodan-style enumeration of the default RPC port is trivial, and AI infrastructure is an increasingly popular target for cryptomining crews and initial access brokers.

Detection & Response

Detection for this threat falls into three buckets: (1) finding vulnerable rpc-server deployments in your environment, (2) detecting anomalous network connections to the RPC port, and (3) catching post-exploitation behavior — the rpc-server process spawning shells or making unexpected outbound connections. Because the exploit operates at the protocol level with no malformed-packet signature you can reliably key on, behavioral detection around the rpc-server process is your highest-fidelity signal.

Sigma Rules

YAML
---
title: llama.cpp RPC Server Spawning Shell or Command Interpreter
id: 3f8c1a92-5d4e-4b7a-9c21-8e6f2a0b4d7c
status: experimental
description: Detects the llama.cpp ggml rpc-server process spawning a shell or scripting interpreter, consistent with post-exploitation activity following CVE-2026-137567 arbitrary heap write / RCE. The rpc-server daemon should never spawn child processes in normal operation.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-137567
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.execution
  - attack.t1059
  - attack.initial_access
  - attack.t1190
logsource:
  category: process_creation
  product: linux
detection:
  selection_parent:
    ParentImage|endswith:
      - '/rpc-server'
  selection_child:
    Image|endswith:
      - '/bash'
      - '/sh'
      - '/dash'
      - '/zsh'
      - '/python'
      - '/python3'
      - '/perl'
      - '/curl'
      - '/wget'
      - '/nc'
      - '/ncat'
  condition: selection_parent and selection_child
falsepositives:
  - Custom wrapper scripts that restart or manage rpc-server (rare; tune by host)
level: critical
---
title: Network Connection to llama.cpp ggml RPC Server Port from Unexpected Source
id: 9d2e7b41-6a3c-4f85-b1d4-7c9a3e5f8b02
status: experimental
description: Detects inbound network connections to the default ggml RPC server port (50052) on hosts running llama.cpp rpc-server. The ggml RPC protocol has no authentication and is the exploitation vector for CVE-2026-137567; any connection from outside the known inference orchestrator subnet is suspicious.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-137567
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.initial_access
  - attack.t1190
  - attack.discovery
  - attack.t1046
logsource:
  category: network_connection
  product: linux
detection:
  selection:
    DestinationPort: 50052
  condition: selection
falsepositives:
  - Legitimate llama.cpp orchestrator-to-worker traffic on port 50052; whitelist known orchestrator IPs and alert on all others
level: high
---
title: llama.cpp RPC Server Listening on Non-Loopback Interface
id: 5b1f9c73-2e8d-4a6c-93b0-1f4d8a2c6e91
status: experimental
description: Detects execution of the llama.cpp rpc-server bound to a non-loopback address (0.0.0.0 or an external interface), which exposes the unauthenticated ggml RPC protocol — the attack surface for CVE-2026-137567 — to the network.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-137567
author: Security Arsenal
date: 2026/04/06
tags:
  - attack.defense_evasion
  - attack.persistence
logsource:
  category: process_creation
  product: linux
detection:
  selection_image:
    Image|endswith:
      - '/rpc-server'
  selection_host:
    CommandLine|contains:
      - '--host 0.0.0.0'
      - '-H 0.0.0.0'
      - '--host 10.'
      - '--host 172.'
      - '--host 192.168.'
  condition: selection_image and selection_host
falsepositives:
  - Legitimate distributed inference deployments binding rpc-server to the cluster interface; this rule is intended to surface inventory and enforce approved bindings
level: medium

KQL (Microsoft Sentinel / Defender)

If your inference workers forward Syslog or run Defender for Endpoint / the Azure Monitor agent, this query hunts for rpc-server processes spawning child shells — the highest-fidelity post-exploitation signal — and for connections to the RPC port from outside your approved orchestrator range. Adjust 10.50.0.0/16 to your actual orchestrator subnet.

KQL — Microsoft Sentinel / Defender
let ApprovedOrchestratorPrefix = "10.50.0.";
union isfuzzy=true
    (DeviceProcessEvents
    | where InitiatingProcessFileName has "rpc-server"
    | where FileName in~ ("bash", "sh", "dash", "python", "python3", "perl", "curl", "wget", "nc", "ncat")
    | project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName),
    (Syslog
    | where Facility =~ "auth" or SyslogMessage has "rpc-server"
    | where SyslogMessage has_any ("rpc-server", "50052")
    | project TimeGenerated, Computer, ProcessName, SyslogMessage),
    (CommonSecurityLog
    | where DestinationPort == 50052
    | where not(SourceIP startswith ApprovedOrchestratorPrefix)
    | summarize ConnectionCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
      by SourceIP, DestinationIP, DestinationPort, DeviceAction
    | order by ConnectionCount desc)

Velociraptor VQL

This artifact inventories rpc-server processes, their listening sockets, and their command lines — letting you simultaneously confirm exposure (non-loopback binds on port 50052) and spot post-exploitation child processes.

VQL — Velociraptor
-- Hunt for llama.cpp rpc-server exposure and suspicious child processes (CVE-2026-137567)
LET rpc_procs = SELECT Pid, Ppid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE Exe =~ 'rpc-server' OR CommandLine =~ 'rpc-server'

LET rpc_listeners = SELECT Pid, Name, Family, Type, Laddr, Lport, Raddr, Rport, Status
FROM netstat()
WHERE (Lport = 50052 OR Name =~ 'rpc-server') AND Status =~ 'LISTEN'

LET rpc_children = SELECT Pid, Ppid, Name, CommandLine, Username, CreateTime
FROM pslist()
WHERE Ppid IN (SELECT Pid FROM rpc_procs)

SELECT 'rpc_process' AS Finding, Pid, Ppid, Name, CommandLine, Username, CreateTime, '' AS Laddr, 0 AS Lport
FROM rpc_procs
UNION ALL
SELECT 'listener' AS Finding, Pid, 0 AS Ppid, Name, '' AS CommandLine, '' AS Username, '' AS CreateTime, Laddr, Lport
FROM rpc_listeners
UNION ALL
SELECT 'child_process_suspicious' AS Finding, Pid, Ppid, Name, CommandLine, Username, CreateTime, '' AS Laddr, 0 AS Lport
FROM rpc_children

Remediation / Verification Script (Bash)

Use this on Linux inference workers to identify the deployed llama.cpp build, flag exposed RPC listeners, and apply compensating controls while you schedule the upgrade to b12658+.

Bash / Shell
#!/bin/bash
# CVE-2026-137567 verification & compensating-control script for llama.cpp ggml rpc-server
# Run as root on each inference worker.

echo "=== [1] Locate rpc-server binaries and running instances ==="
pgrep -a -f 'rpc-server' || echo "No running rpc-server process found."
find /usr /opt /home -name 'rpc-server' -type f -executable 2>/dev/null

echo ""
echo "=== [2] Check deployed llama.cpp build (must be b12658 or later) ==="
RPC_BIN=$(find /usr /opt /home -name 'rpc-server' -type f -executable 2>/dev/null | head -n1)
if [ -n "$RPC_BIN" ]; then
    "$RPC_BIN" --help 2>&1 | head -n5
    BUILD=$("$RPC_BIN" --version 2>/dev/null | grep -oE 'b[0-9]+' | head -n1 | tr -d 'b')
    if [ -n "$BUILD" ] && [ "$BUILD" -ge 11450 ] && [ "$BUILD" -lt 12658 ]; then
        echo "[!!] VULNERABLE: build b$BUILD is in the affected range (b11450 - b12657). Upgrade to b12658+."
    elif [ -n "$BUILD" ] && [ "$BUILD" -ge 12658 ]; then
        echo "[OK] Build b$BUILD is patched."
    else
        echo "[??] Could not determine build number — verify manually against the release tag."
    fi
fi

echo ""
echo "=== [3] Identify exposed RPC listeners (default port 50052) ==="
ss -tlnp | grep -E ':(50052)' && echo "[!!] RPC port listening — verify bind address and source restrictions."

echo ""
echo "=== [4] Compensating control: restrict port 50052 to orchestrator subnet only ==="
# Adjust ORCHESTRATOR_SUBNET to your environment before running.
ORCHESTRATOR_SUBNET="10.50.0.0/16"
iptables -C INPUT -p tcp --dport 50052 -s "$ORCHESTRATOR_SUBNET" -j ACCEPT 2>/dev/null || \
    iptables -I INPUT 1 -p tcp --dport 50052 -s "$ORCHESTRATOR_SUBNET" -j ACCEPT
iptables -C INPUT -p tcp --dport 50052 -j DROP 2>/dev/null || \
    iptables -I INPUT 2 -p tcp --dport 50052 -j DROP
echo "[OK] iptables: port 50052 now restricted to $ORCHESTRATOR_SUBNET (all other sources dropped)."

echo ""
echo "=== [5] Recommend: bind rpc-server to a private/loopback interface ==="
echo "Start rpc-server with --host <cluster-internal-IP> or 127.0.0.1 where topology allows,"
echo "and place workers behind a firewall or WireGuard/Tailscale overlay — never expose 50052 to the internet."

Remediation

  1. Upgrade immediately to llama.cpp build b12658 or later. This is the only complete fix — the patch corrects the bounds validation in the ggml RPC server's tensor copy handling so zero-element destination tensors can no longer drive pointer arithmetic below the buffer base. Rebuild from source at the fixed tag or pull the updated release artifacts. Verify every worker node — in distributed deployments, one forgotten worker is a standing invitation.
  2. Inventory your exposure today. Most organizations do not have llama.cpp in their CMDB because it arrives via developer workstations, research clusters, and side-channel AI projects, not procurement. Search for rpc-server binaries and port 50052 listeners across your estate (the VQL artifact and Bash script above will do this at scale).
  3. Never expose the ggml RPC port to untrusted networks. The protocol has no authentication — even patched, it should be treated as a privileged management interface. Bind rpc-server to a cluster-internal interface, restrict source IPs with host firewall rules (see script step 4), and consider tunneling RPC traffic over WireGuard, Tailscale, or an SSH tunnel.
  4. Check for internet exposure. Query Shodan/Censys for your ASN and public ranges on port 50052. If any worker is reachable from the internet and ran a build in the vulnerable range, treat it as potentially compromised: capture memory and disk before rebuilding, review outbound connections and process history, and rotate any credentials or tokens stored on the host (inference workers frequently hold cloud storage keys and model registry tokens).
  5. Reduce blast radius. Run rpc-server as a dedicated low-privilege service account with no sudo rights, in a network segment that cannot reach domain controllers, secrets stores, or production data. GPU workers holding proprietary fine-tuned models should also have egress filtering — a compromised worker should not be able to exfiltrate model weights.
  6. Monitor for KEV addition. Given the CVSS 9.8 score, unauthenticated network vector, and massive deployment base, watch the CISA Known Exploited Vulnerabilities catalog and the NVD entry (https://nvd.nist.gov/vuln/detail/CVE-2026-137567) for exploitation updates. If it lands on KEV, federal agencies will face a remediation deadline and your own SLAs should follow suit.

The broader lesson for AI infrastructure security: inference runtimes are becoming critical production infrastructure, but they carry the security posture of research code. The ggml RPC protocol assumes a trusted network — and CVE-2026-137567 is what that assumption costs when it meets reality. Get these components into your vulnerability management program, your asset inventory, and your network segmentation architecture before the next one drops.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.

CVE-2026-137567: Critical llama.cpp ggml RPC Server RCE — Detection and Remediation Guide | Security Arsenal | Security Arsenal