PT-2026-2109 · Llama.Cpp · Llama.Cpp

Tylzh97

·

Published

2026-01-07

·

Updated

2026-04-24

·

CVE-2026-21869

CVSS v3.1

9.8

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions llama.cpp versions prior to commit 55d4206c9
Description llama.cpp is an inference engine for several Large Language Models (LLMs) implemented in C/C++. The software parses the n discard parameter directly from JSON input in its completion endpoints without validating that it is non-negative. Supplying a negative value for this parameter, when the context is full, can lead to out-of-bounds memory writes within the llama memory seq rm/add function during the token evaluation loop. This memory corruption can result in a process crash or potentially enable remote code execution (RCE). The vulnerable component is the parsing of the n discard parameter in the completion API endpoints.
Recommendations At the moment, there is no information about a newer version that contains a fix for this vulnerability.

Exploit

RCE

Memory Corruption

Weakness Enumeration

Related Identifiers

CVE-2026-21869
GHSA-8947-PFFF-2F3C

Affected Products

Llama.Cpp