CVE-2026-34159
Received Received - Intake
Memory Corruption in llama.cpp RPC Enables Remote Code Execution

Publication date: 2026-04-01

Last updated on: 2026-04-30

Assigner: GitHub, Inc.

Description
llama.cpp is an inference of several LLM models in C/C++. Prior to version b8492, the RPC backend's deserialize_tensor() skips all bounds validation when a tensor's buffer field is 0. An unauthenticated attacker can read and write arbitrary process memory via crafted GRAPH_COMPUTE messages. Combined with pointer leaks from ALLOC_BUFFER/BUFFER_GET_BASE, this gives full ASLR bypass and remote code execution. No authentication required, just TCP access to the RPC server port. This issue has been patched in version b8492.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-01
Last Modified
2026-04-30
Generated
2026-05-07
AI Q&A
2026-04-01
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
ggml llama.cpp to b8492 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-119 The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability CVE-2026-34159 allows unauthenticated remote code execution with full read and write access to process memory, leading to high confidentiality, integrity, and availability impact. This means sensitive data handled by the affected system could be exposed or altered without authorization.

Such a critical security flaw could lead to violations of data protection regulations like GDPR or HIPAA, which require strict controls to protect personal and sensitive information from unauthorized access and modification.

Specifically, the ability for an attacker to bypass authentication and execute arbitrary commands remotely could result in unauthorized disclosure or alteration of protected data, undermining compliance with these standards.

Therefore, organizations using vulnerable versions of llama.cpp RPC backend may face compliance risks if this vulnerability is exploited, especially if the system processes regulated personal or health data.


How can this vulnerability impact me? :

This vulnerability can have severe impacts including full remote code execution on the server running llama.cpp, often with root privileges in Docker environments. An attacker can read and write arbitrary memory, bypass security protections like ASLR and NX, and execute arbitrary system commands.

  • Complete compromise of the server process, leading to potential data theft or destruction.
  • Lateral movement within corporate or cloud networks by scanning for exposed RPC ports.
  • Potential local privilege escalation if the RPC backend is exposed locally.
  • Denial of service due to server crashes after exploitation.

Because the RPC backend is disabled by default and typically bound to localhost, the risk depends on network exposure and configuration. However, if exposed via Docker port forwarding or network settings, the vulnerability poses a critical risk.


Can you explain this vulnerability to me?

CVE-2026-34159 is a critical remote code execution vulnerability in the llama.cpp project's RPC backend. The issue arises because the deserialize_tensor() function fails to validate tensor buffers when the buffer field is set to 0 (null). This allows an unauthenticated attacker with TCP access to the RPC server port to read and write arbitrary process memory by sending specially crafted GRAPH_COMPUTE messages.

The exploit involves bypassing address space layout randomization (ASLR) by leaking pointers through ALLOC_BUFFER and BUFFER_GET_BASE commands, then using the GRAPH_COMPUTE command with buffer=0 tensors to perform arbitrary memory reads and writes. Attackers can leak and overwrite function pointers in buffer structs, ultimately hijacking control flow to execute arbitrary system commands remotely as the server process user, often root.

This vulnerability requires no authentication or user interaction and has a very high impact on confidentiality, integrity, and availability. It was introduced in the initial RPC implementation and remained unpatched until version b8492.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by scanning for exposed RPC server ports (default TCP port 50052) on systems running vulnerable versions of llama.cpp (prior to commit b8492). Since the exploit requires TCP access to the RPC server port, network scanning tools can identify potentially vulnerable hosts.

Detection commands may include using network scanning tools such as:

  • nmap -p 50052 --open -sV <target_ip> # Scan for open RPC server port 50052
  • netstat -tulnp | grep 50052 # Check locally if the RPC server port is listening
  • ss -tuln | grep 50052 # Alternative to netstat to check listening ports

Additionally, monitoring logs for unexpected GRAPH_COMPUTE commands or malformed tensor deserialization attempts may help detect exploitation attempts, but specific commands for this are not provided in the available resources.


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to upgrade llama.cpp to version b8492 or later, where the vulnerability has been patched by adding proper validation of the tensor buffer field during deserialization.

If upgrading is not immediately possible, consider the following steps:

  • Disable the RPC backend by not enabling the -DGGML_RPC=ON build option or by blocking TCP port 50052 on firewalls to prevent network access to the vulnerable RPC server.
  • Restrict network access to the RPC server port to trusted hosts only, avoiding exposure to untrusted networks or the internet.
  • Monitor for suspicious activity related to GRAPH_COMPUTE commands or unexpected RPC traffic.

Note that the patch was merged on March 23, 2026, and is available in the master branch; applying this patch or updating to a fixed release is the definitive fix.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart