{"id":"CVE-2026-137057","aliases":[],"title":"llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence","originalDescription":"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.","severity":{"cvss":8.7,"vector":"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","label":"high"},"exploitation":{"kev":null,"epss":{"score":0.01269,"percentile":0.69848},"exploitDb":null},"affected":[{"ecosystem":"vendor","name":"llama.cpp","range":">=b7118, <b12604","fixed":"b12604"}],"references":[{"url":"https://github.com/ggml-org/llama.cpp/issues/32550","type":"issue-tracking"},{"url":"https://github.com/ggml-org/llama.cpp/pull/32551","type":"issue-tracking"},{"url":"https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5","type":"patch"},{"url":"https://github.com/ggml-org/llama.cpp/blob/b12603/src/llama-grammar.cpp#L519-L522","type":"technical-description"},{"url":"https://github.com/ggml-org/llama.cpp/releases/tag/b12604","type":"release-notes"},{"url":"https://www.vulncheck.com/advisories/llama-cpp-b7118-before-b12604-integer-underflow-in-grammar-parser-parse-sequence","type":"third-party-advisory"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/137xxx/CVE-2026-137057.json","type":"advisory"},{"url":"https://github.com/ggml-org/llama.cpp","type":"package"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137057","type":"advisory"}],"sources":[{"name":"nvd","at":"2026-11-25T20:25:28.888Z","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137057","license":"NVD terms of use","firstSeenAt":"2026-11-25T20:25:28.888Z"},{"name":"osv","at":"2026-11-26T21:45:24.285Z","url":"https://osv.dev/vulnerability/CVE-2026-137057","license":"CC-BY 4.0","firstSeenAt":"2026-11-25T21:33:04.032Z"},{"name":"cvelistV5","at":"2026-11-28T22:07:52.574Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-137057","license":"CVE Terms of Use","firstSeenAt":"2026-11-25T19:49:54.812Z"}],"firstSeenAt":"2026-11-25T19:49:54.812Z","publishedAt":"2026-11-25T19:33:20.574Z","modifiedAt":"2026-11-26T21:02:14.141Z"}