CVE-2026-21869 Details
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.
A vulnerability in llama.cpp, an inference implementation for various large language models, allows for out-of-bounds memory writes that can lead to process crashes or remote code execution. This issue arises in versions through commit 55d4206c8, where the n_discard parameter is improperly validated before being parsed from JSON input in the server's completion endpoints. When a negative value is introduced and the context becomes full, it causes a desynchronization in the key-value cache, creating an opportunity for memory corruption during token evaluation. The vulnerability is exploitable through the public completions, chat completions, and slots resume endpoints, particularly when the server is running with context shift enabled.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jan 8, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8947-pfff-2f3c | CISA-ADP | ExploitVendor Advisory |
| https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8947-pfff-2f3c | [email protected] | ExploitVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-787 | Out-of-bounds Write | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| ggml llama.cpp | All versions |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Feb 2, 2026 | Initial Analysis | [email protected] |
| Jan 8, 2026 | CVE Modified | CISA-ADP |
| Jan 8, 2026 | New CVE Received | [email protected] |