IT SBIT Services
Schneeberger
DEEN
CVE tracker

llama.cpp: Out-of-bounds read via unvalidated token IDs in llama-server

CVE-2024-58400High 8.8

← All vulnerabilities

Summary

llama.cpp before b3701 does not validate token IDs in llama_decode_internal and llama_encode_internal. A remote, unauthenticated attacker can send integer-array prompts with out-of-range token IDs to the llama-server /completion endpoint. This can leak memory outside the intended buffer or crash the process.

Affected

  • llama.cpp versions before b3701 (ggml-org)
  • Exposed llama-server instances using the /completion endpoint

Fixed in

  • Upgrade to llama.cpp b3701 or later
  • Fix commit: eae597182cb61bbde0b26e7cec5999d28b9327fe

Workaround

Unknown.

Exploitation

  • Not known to be exploited in the wild (per OffSeq; KEV: No)
  • No public proof of concept found for this CVE
  • EPSS: 0.42 %
  • CISA SSVC: exploitation none, automatable yes, technical impact partial

Our recommendation

  • Inventory all llama.cpp and llama-server instances
  • Confirm that no llama-server instance is reachable from the internet or untrusted networks
  • Bind llama-server to localhost or an internal interface and place an authenticating reverse proxy in front of it
  • Upgrade to b3701 or later, and preferably to the latest release, as a related out-of-bounds write (CVE-2026-21869) is reported
  • Check whether your Linux distribution ships a fixed build

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 10:18.

Original description (NVD)

llama.cpp before b3701 contains an out-of-bounds read vulnerability in llama_decode_internal and llama_encode_internal that allows remote unauthenticated attackers to read memory by supplying unvalidated token IDs. Attackers can send integer-array prompts to the llama-server /completion endpoint with IDs outside 0 to n_vocab to read embedding memory out of bounds or crash the process.

NVD references (6)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.