{"id":"CVE-2026-137057","state":"PUBLISHED","title":"llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence","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.","publishedAt":"2026-11-25T19:33:20.574Z","updatedAt":"2026-11-25T19:53:43.377Z","severity":{"score":8.7,"label":"High","version":"4.0","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","source":"VulnCheck"},"assigner":"VulnCheck","products":["ggml-org llama.cpp"],"affected":[{"vendor":"ggml-org","product":"llama.cpp","packageURL":"pkg:github/ggml-org/llama.cpp","defaultStatus":"unaffected","versions":[{"version":"b7118","status":"affected","lessThan":"b12604","versionType":"custom"}],"repo":"https://github.com/ggml-org/llama.cpp"}],"references":["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"],"weaknesses":["CWE-191"],"ingestedAt":"2026-11-25T20:00:06.381Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/137xxx/CVE-2026-137057.json","commit":"5e1f64d3169266280a9bad30233097a7073026ad","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-137057","state":"PUBLISHED","datePublished":"2026-11-25T19:33:20.574Z","dateUpdated":"2026-11-25T19:53:43.377Z","assignerShortName":"VulnCheck","assignerOrgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateReserved":"2026-11-25T17:56:22.644Z"},"containers":{"cna":{"title":"llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"ggml-org","product":"llama.cpp","packageURL":"pkg:github/ggml-org/llama.cpp","defaultStatus":"unaffected","versions":[{"version":"b7118","status":"affected","lessThan":"b12604","versionType":"custom"}],"repo":"https://github.com/ggml-org/llama.cpp"}],"references":[{"url":"https://github.com/ggml-org/llama.cpp/issues/32550","tags":["issue-tracking"]},{"url":"https://github.com/ggml-org/llama.cpp/pull/32551","tags":["issue-tracking","patch"]},{"url":"https://github.com/ggml-org/llama.cpp/commit/46eb1742db6d2caec1bfa848c5702b1bdcc815e5","tags":["patch"]},{"url":"https://github.com/ggml-org/llama.cpp/blob/b12603/src/llama-grammar.cpp#L519-L522","tags":["technical-description"]},{"url":"https://github.com/ggml-org/llama.cpp/releases/tag/b12604","tags":["release-notes"],"name":"llama.cpp b12604 Release Notes"},{"url":"https://www.vulncheck.com/advisories/llama-cpp-b7118-before-b12604-integer-underflow-in-grammar-parser-parse-sequence","name":"VulnCheck Advisory: llama.cpp b7118 before b12604 Integer Underflow in Grammar Parser parse_sequence","tags":["third-party-advisory"]}],"metrics":[{"format":"CVSS","cvssV4_0":{"version":"4.0","vectorString":"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","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":8.7,"baseSeverity":"HIGH"}},{"format":"CVSS","cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"HIGH","baseScore":7.5,"baseSeverity":"HIGH"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-191","lang":"en","description":"Integer Underflow (Wrap or Wraparound)","type":"CWE"}]}],"providerMetadata":{"shortName":"VulnCheck","orgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateUpdated":"2026-11-25T19:33:20.574Z"},"datePublic":"2026-11-18T00:00:00.000Z","cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:a:ggml:llama.cpp:*:*:*:*:*:*:*:*","versionStartIncluding":"b7118","versionEndExcluding":"b12604"}]}]}],"credits":[{"lang":"en","value":"Daniil Kuts","type":"finder"}],"x_generator":{"engine":"vulncheck-endgame"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/ggml-org/llama.cpp/issues/32550","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-11-25T19:53:21.993692Z","id":"CVE-2026-137057","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-11-25T19:53:43.377Z"}}]}}}