CVE-2026-137057: llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence

Published Nov 25, 2026
·
Updated

llama.cpp from b7118 before b12604 contains an integer underflow vulnerability in llamagrammarparser::parsesequence() that allows unauthenticated remote attackers to cause denial of service by supplying GBNF repetitions with max lower than min. Attackers can send a grammar like {5,2} in the grammar field of a llama-server /completion request, wrapping nopt to generate endless repetition rules that hang the process and exhaust memory.

Affected Software

1 affected component
llama.cpp llama.cpp>=b7118<b12604

Event History

Nov 25, 2026
CVE Published
via MITRE·07:33 PM
Data Sourced
via MITRE·07:33 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments running llama.cpp versions from b7118 before b12604 are affected when they expose llama-server and accept /completion requests containing a grammar field.

2

What does an attacker need to exploit the flaw?

An attacker needs only network access to send an unauthenticated /completion request to llama-server. They can supply a GBNF repetition whose maximum is lower than its minimum, such as {5,2}.

3

What is the operational impact of successful exploitation?

The malformed repetition causes an integer underflow that can generate endless repetition rules. This can hang the process and exhaust memory, resulting in denial of service.

4

How can defenders identify attempted exploitation?

Inspect llama-server /completion requests that include a grammar field for GBNF repetition ranges where the maximum value is lower than the minimum value, such as {5,2}.

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