# CVE-2026-137057: llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence

- Severity: High 8.7 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.27%, higher than 70% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-11-25T19:33:20.574Z
- Modified: 2026-11-25T20:18:39.450Z
- Weaknesses: CWE-191
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: VulnCheck

## 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.

(As written by CVE List.)

## Affected

- ggml-org llama.cpp: from b7118 before b12604

## Every score

- VulnCheck: CVSS:4.0 8.7 High `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`
- VulnCheck: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/ggml-org/llama.cpp/issues/32550> (exploit, issue-tracking)
- <https://github.com/ggml-org/llama.cpp/pull/32551> (issue-tracking, patch)
- <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)

## Sources

- CVE List: [CVE-2026-137057](https://www.cve.org/CVERecord?id=CVE-2026-137057), CVE Terms of Use, modified 2026-11-25
- NVD: [CVE-2026-137057](https://nvd.nist.gov/vuln/detail/CVE-2026-137057), Public domain, modified 2026-11-25

---

Page: https://cve.day/CVE-2026-137057 · Whole record: https://cve.day/CVE-2026-137057.json · Rebuilt by cve.day 2026-11-25T23:18:44.307Z
