CVE-2026-21869

8.8

ggml-org · llama.cpp

The llama.cpp server component is vulnerable to an out-of-bounds memory write via unvalidated JSON input, potentially leading to process crashes or remote code execution.

Executive summary

A critical out-of-bounds write vulnerability in llama.cpp allows unauthenticated attackers to trigger memory corruption and potential remote code execution.

Vulnerability

The vulnerability exists because the n_discard parameter in the server completion endpoints is not validated for non-negative values. An unauthenticated attacker can supply a malicious negative integer, causing the system to perform out-of-bounds memory writes during token evaluation.

Business impact

Successful exploitation of this flaw can lead to full system compromise, as the memory corruption is deterministic and allows for remote code execution. Given the CVSS score of 8.8, this represents a high risk to business operations, potentially resulting in unauthorized data access or complete service disruption.

Remediation

Immediate Action: As no official patch is currently available, restrict access to the llama.cpp server endpoints to trusted networks only and disable the server component if it is not strictly required.

Proactive Monitoring: Review application logs for unusual JSON payloads directed at completion endpoints and monitor for unexpected process termination or instability.

Compensating Controls: Deploy a Web Application Firewall (WAF) or equivalent inspection layer to filter incoming JSON requests and block inputs containing negative values for the n_discard parameter.

Exploitation status

Public Exploit Available: Unknown.

Analyst recommendation

This vulnerability presents a significant security risk due to the potential for unauthenticated remote code execution. Organizations currently utilizing llama.cpp must prioritize network-level isolation of the service and monitor vendor security advisories closely for the release of an official patch. Until a fix is deployed, assume the service is susceptible to exploitation and apply the recommended compensating controls immediately.

More ggml-org CVEs

Sources