Ggml-org llama.cpp
llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= b7118, < b12604
Fixed in b12604
Mitigation
Upgrade llama.cpp to b12604 or later.
References
Timeline
Days relative to CVE publicationFirst public PoC 9 h after publication; not in CISA KEV. First PoC: googlesky/CVE-2026-137057 (created 26 Nov 2026, found by us: 26 Nov 2026).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Found by us | Stars | Assessment |
|---|---|---|---|---|
| googlesky/CVE-2026-137057 | 26 Nov 2026 +9 h | 26 Nov 2026 | 0 | PoC |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.