CVE-2026-21869: ggml-org llama.cpp · Out-of-bounds Write
Affects ggml-org llama.cppSource CVE Database V5
Not known to be exploited · CVSS 8.8 High.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.5% chance of exploitation in 30 days – higher than 44% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 7 Jan 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| ggml-orgllama.cpp | Affected
| Fixed in– |
AI-suggested
To mitigate CVE-2026-21869, European organizations should implement strict input validation on the n_discard parameter to ensure it is non-negative before processing. If modifying llama.cpp source code is feasible, adding validation checks or sanitizing JSON inputs at the server endpoint is critical. Until an official patch is released, organizations should restrict network access to the llama.cpp completion endpoints using firewalls or network segmentation to limit exposure to trusted users only. Employ Web Application Firewalls (WAFs) or intrusion detection systems to detect and block anomalous JSON payloads containing negative n_discard values. Monitoring logs for unusual requests or crashes related to llama.cpp servers can provide early warning of exploitation attempts. Running llama.cpp inference servers with least privilege and containerization can reduce the impact of potential compromises. Organizations should also consider alternative LLM inference implementations or temporarily disable exposed endpoints if risk is unacceptable. Finally, maintain close monitoring of vendor updates and community advisories for patches or workarounds.
Description
llama.cpp is an inference of several LLM models in C/C++. In commits 55d4206c8 and prior, the n_discard parameter is parsed directly from JSON input in the llama.cpp server's completion endpoints without validation to ensure it's non-negative. When a negative value is supplied and the context fills up, llama_memory_seq_rm/add receives a reversed range and negative offset, causing out-of-bounds memory writes in the token evaluation loop. This deterministic memory corruption can crash the process or enable remote code execution (RCE). There is no fix at the time of publication.