CVE-2026-137057
Integer underflow DoS in llama.cpp grammar parser
- CVSS 4.0
- 8.7 high
- EPSS
- —
- Published
- ·
- Modified
llama.cpp before b12604 has an integer underflow in llama_grammar_parser::parse_sequence(). An unauthenticated remote attacker can send a llama-server /completion request whose grammar field uses a GBNF repetition with max lower than min (for example {5,2}). That wraps n_opt into endless repetition rules, hanging the process and exhausting memory. Builds from b7118 before b12604 are affected.
What to do: Upgrade llama.cpp to b12604 or later.
| Product | Affected | Fixed in |
|---|---|---|
| llama.cpp | b7118 before b12604 | b12604 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
Description · NVD
llama.cpp from b7118 before b12604 contains an integer underflow vulnerability in llama_grammar_parser::parse_sequence() 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 n_opt to generate endless repetition rules that hang the process and exhaust memory.
- Weakness
- CWE-191
- Vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
In the news
0 storiesNo ingested article mentions this CVE yet.