CVE-2026-137057
llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence
High · 8.7Fix available
- CVSS
- 8.7
- EPSS
- 1.27% (p70)
- Published
- 2026-11-25
- Age
- 3d old
- Modified
- 2026-11-26
- Product
- ggml-org llama.cpp
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
Description
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.
Fixed in
b12604
Affected packages
| Ecosystem | Package | Range | Fixed |
|---|---|---|---|
| vendor | llama.cpp | >=b7118, <b12604 | b12604 |
Sources
- NVD · first seen 3d ago · NVD terms of use
- OSV · first seen 3d ago · CC-BY 4.0
- CVE List · first seen 3d ago · CVE Terms of Use
References
- https://github.com/ggml-org/llama.cpp/issues/32550 issue-tracking
- https://github.com/ggml-org/llama.cpp/pull/32551 issue-tracking
- https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5 patch
- https://github.com/ggml-org/llama.cpp/blob/b12603/src/llama-grammar.cpp#L519-L522 technical-description
- https://github.com/ggml-org/llama.cpp/releases/tag/b12604 release-notes
- https://www.vulncheck.com/advisories/llama-cpp-b7118-before-b12604-integer-underflow-in-grammar-parser-parse-sequence third-party-advisory
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/137xxx/CVE-2026-137057.json advisory
- https://github.com/ggml-org/llama.cpp package
- https://nvd.nist.gov/vuln/detail/CVE-2026-137057 advisory