CVE-2026-21869

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

Configuration 1 (hide)

cpe:2.3:a:ggml:llama.cpp:-:*:*:*:*:*:*:*

History

17 Jun 2026, 10:19

Type Values Removed Values Added
Summary
  • (es) llama.cpp es una inferencia de varios modelos LLM en C/C++. En los commits 55d4206c8 y anteriores, el parámetro n_discard se analiza directamente de la entrada JSON en los puntos finales de completado del servidor de llama.cpp sin validación para asegurar que no sea negativo. Cuando se suministra un valor negativo y el contexto se llena, llama_memory_seq_rm/add recibe un rango invertido y un desplazamiento negativo, causando escrituras de memoria fuera de límites en el bucle de evaluación de tokens. Esta corrupción de memoria determinista puede bloquear el proceso o permitir la ejecución remota de código (RCE). No hay una solución en el momento de la publicación.

02 Feb 2026, 19:12

Type Values Removed Values Added
First Time Ggml
Ggml llama.cpp
References () https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8947-pfff-2f3c - () https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8947-pfff-2f3c - Exploit, Vendor Advisory
CPE cpe:2.3:a:ggml:llama.cpp:-:*:*:*:*:*:*:*

08 Jan 2026, 20:15

Type Values Removed Values Added
References () https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8947-pfff-2f3c - () https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-8947-pfff-2f3c -

08 Jan 2026, 00:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-01-08 00:16

Updated : 2026-06-17 10:19


NVD link : CVE-2026-21869

Mitre link : CVE-2026-21869

CVE.ORG link : CVE-2026-21869


JSON object : View

Products Affected

ggml

  • llama.cpp
CWE
CWE-787

Out-of-bounds Write