BreachSpiderVerified, not vibes

CVE-2026-21869 in Ggml Llama.Cpp

Critical 9.8

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_...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.19.8
EPSS0.8%
EPSS percentile55th
FixUnknown

Remotely exploitable over the network, low complexity, no authentication required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Ggml Llama.Cpp No version listed by the source

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Vendor PSIRT: [email protected]

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official 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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2026-21869
BreachSpider IDBS-2026-GLOBAL-065507-C
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Published2026-01-08
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-787: Out-of-Bounds Write

Software writes data past buffer boundaries, corrupting memory and potentially enabling code execution.

Analysis AI-written, not human-reviewed

CVE-2026-21869 affects llama.cpp, a C/C++ implementation for several LLM models, by allowing out-of-bounds memory access due to improper validation of the n_discard parameter in JSON input.

An attacker can exploit this vulnerability by sending a JSON request with a negative value for the n_discard parameter to the llama.cpp server's completion endpoints. This can lead to out-of-bounds memory access, potentially allowing for arbitrary code execution or information disclosure.

Questions

What is CVE-2026-21869?

CVE-2026-21869 affects llama.cpp, a C/C++ implementation for several LLM models, by allowing out-of-bounds memory access due to improper validation of the n_discard parameter in JSON input.

What is the CVSS score for CVE-2026-21869?

CVE-2026-21869 has CVSS 9.8 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. EPSS: 0.8%.

Is CVE-2026-21869 actively exploited?

No confirmed active exploitation of CVE-2026-21869 as of 2026-09-25.

How do I remediate CVE-2026-21869?

Priority: IMMEDIATE. PSIRT: [email protected]

What systems are affected by CVE-2026-21869?

CVE-2026-21869 affects Ggml Llama.Cpp.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Ggml","product":"Llama.Cpp","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.