CVE-2026-21869: llama.cpp has Out-of-bounds Write in llama-server

Published Jan 7, 2026
·
Updated

llama.cpp is an inference of several LLM models in C/C++. In commits 55d4206c8 and prior, the ndiscard 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, llamamemoryseqrm/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.

Affected Software

2 affected components
llama.cpp<55d4206c8
ggml llama.cpp

Event History

Jan 7, 2026
CVE Published
via MITRE·11:37 PM
Data Sourced
via MITRE·11:37 PM
DescriptionSeverityWeakness
Jan 8, 2026
Data Sourced
via NVD·12:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-21869?

CVE-2026-21869 has a medium severity rating due to the potential for negative values to cause unexpected behavior.

2

How do I fix CVE-2026-21869?

To fix CVE-2026-21869, ensure that the n_discard parameter is validated to be non-negative before processing it.

3

Which versions of llama.cpp are affected by CVE-2026-21869?

CVE-2026-21869 affects llama.cpp versions prior to 55d4206c8.

4

What is the impact of CVE-2026-21869?

CVE-2026-21869 can lead to application crashes or erratic behavior if a negative n_discard value is supplied.

5

Is there a known exploit for CVE-2026-21869?

As of now, there is no public record of an exploit specifically targeting CVE-2026-21869.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203