Skip to content
HighVulnerabilityLLM-specific

CVE-2026-21869: llama.cpp out-of-bounds write via negative n_discard in server

Identifier
CVE-2026-21869
Published
Record updated
View JSON
Fixed in
The source references a patch, a mitigation or a vendor advisory.
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.5%Estimated probability that this CVE is exploited in the next 30 days, from the FIRST Exploit Prediction Scoring System. Read on .

Summary

CVE-2026-21869 affects llama.cpp in commits 55d4206c8 and prior. The n_discard parameter is parsed from JSON in the server's completion endpoints without a check that it is non-negative. A negative value, once the context fills, passes a reversed range and negative offset to llama_memory_seq_rm/add, causing out-of-bounds memory writes in the token evaluation loop. The corruption is deterministic and can crash the process or enable remote code execution.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.