Preliminary notice: published right away from the original source data, without editorial write-up. It will shortly be replaced by a written and reviewed version.
Summary
CVE-2026-137057: high-severity vulnerability (CVSS 8.7) in ggml-org llama.cpp.
What happened
Original description from the source: 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.
Why it matters
High severity, CVSS 8.7.
Affected products and versions
ggml-org llama.cpp >= b7118, < b12604
| Product | Versions | Fixed in |
|---|---|---|
| ggml-org llama.cpp | >= b7118, < b12604 | — |
Action recommended by the source
See the official references for the fix or mitigation.
Sources and references
- https://github.com/ggml-org/llama.cpp/issues/32550 — CVE Program
- https://github.com/ggml-org/llama.cpp/pull/32551 — CVE Program
- https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5 — CVE Program
- https://github.com/ggml-org/llama.cpp/blob/b12603/src/llama-grammar.cpp#L519-L522 — CVE Program
- https://github.com/ggml-org/llama.cpp/releases/tag/b12604 — CVE Program
- https://www.vulncheck.com/advisories/llama-cpp-b7118-before-b12604-integer-underflow-in-grammar-parser-parse-sequence — CVE Program
Weaknesses (CWE): CWE-191
Relevant change history
Published
Preliminary advisory published.