CVE-2026-137057
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.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
Mitigation details
CVE-2026-137057 NameCVE-2026-137057 Descriptionllama.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,…
CVE-2026-137057
| Name | CVE-2026-137057 |
| 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. |
| Source | CVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more) |
Vulnerable and fixed packages
The table below lists information on source packages.
| Source Package | Release | Version | Status |
|---|---|---|---|
| llama.cpp (PTS) | forky | 1:1.0.0+dfsg-1 | vulnerable |
| sid | 1:1.1.0+dfsg-2 | fixed |
The information below is based on the following data on fixed versions.
| Package | Type | Release | Fixed Version | Urgency | Origin | Debian Bugs |
|---|---|---|---|---|---|---|
| llama.cpp | source | (unstable) | 1:1.1.0+dfsg-1 |
Notes
https://github.com/ggml-org/llama.cpp/issues/32550
https://github.com/ggml-org/llama.cpp/pull/32551
https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5 (v1.1.0)
Apply commands
https://github.com/ggml-org/llama.cpp/issues/32550https://github.com/ggml-org/llama.cpp/pull/32551https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5 (v1.1.0)
OS impact
Debian Mixed 2 releases
| Version | Package | Status | Fixed in |
|---|---|---|---|
| sid | llama.cpp |
Fixed | 1:1.1.0+dfsg-1 |
| forky | llama.cpp |
Affected | — |
Application impact
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| ggml-org | llama.cpp | {"startIncluding":"b7118","endExcluding":"b12604"} | b12604 |
References
- https://github.com/ggml-org/llama.cpp/blob/b12603/src/llama-grammar.cpp#L519-L522
- https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5
- https://github.com/ggml-org/llama.cpp/issues/32550
- https://github.com/ggml-org/llama.cpp/pull/32551
- https://github.com/ggml-org/llama.cpp/releases/tag/b12604
- https://www.vulncheck.com/advisories/llama-cpp-b7118-before-b12604-integer-underflow-in-grammar-parser-parse-sequence
- https://security-tracker.debian.org/tracker/CVE-2026-137057
CWEs
CWE-191
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.