CVE-2026-137057
CVE-2026-137057 · llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence
CVSS 8.7 · High · EPSS 1.3% · Public exploit
Compare with your installed version
Affected products and known fixed versions are public information. Compare them with your installed version.
- llama.cppNo fix published
- llama.cpp Ubuntu 26.10No fix published
- llama.cpp Ubuntu 26.04 LTSNo fix published
Check the installed version:
dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="llama.cpp"'Assess your server’s risks
The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.
Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.
curl -fsSL https://patchfirst.dev/check.sh | shChannels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
- Published
- Updated
Stack: system
Affected products and versions
llama.cpp
- Versions
- ≥ b7118, < b12604: Affected (custom)
No fix published
llama.cpp Ubuntu 26.10
- Versions
- 8681+dfsg-1
- 9721+dfsg-1ubuntu1
- 10438+dfsg-1
- 10438+dfsg-1ubuntu1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
llama.cpp Ubuntu 26.04 LTS
- Versions
- 5882+dfsg-2
- 8064+dfsg-1ubuntu1
- 8681+dfsg-1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- 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
- https://github.com/ggml-org/llama.cpp/blob/b12603/src/llama-grammar.cpp#L519-L522
- 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://nvd.nist.gov/vuln/detail/CVE-2026-137057