CVE-2026-21869

Description

A flaw was found in llama.cpp. A remote attacker can exploit an input validation vulnerability in the server's completion endpoints. By supplying a negative value for the n_discard parameter in JSON input, an attacker can cause out-of-bounds memory writes. This can lead to a process crash or enable remote code execution (RCE), allowing the attacker to run arbitrary code on the affected system.

Statement

This vulnerability is rated Important as it allows remote code execution in the llama.cpp server. An unauthenticated remote attacker can trigger out-of-bounds memory writes by providing a negative n_discard parameter in JSON input to the server's completion endpoints, leading to a crash or arbitrary code execution. This could impact deployments where the llama.cpp server is exposed to untrusted networks.

Understanding the Weakness (CWE)

Integrity

Technical Impact: Modify Memory; Execute Unauthorized Code or Commands

Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.

Other

Technical Impact: Unexpected State

Subsequent write operations can produce undefined or unexpected results.

Frequently Asked Questions

Want to get errata notifications? Sign up here.