llama.cpp Patched for High-Severity Integer Underflow in Grammar Parser

2 min read
Source: CVEs | Zero Wire | Cloudflare Radar
llama.cpp Patched for High-Severity Integer Underflow in Grammar Parser
Photo: CVEs | Zero Wire | Cloudflare Radar
TL;DR

A high-severity integer underflow vulnerability in llama.cpp's grammar parser, allowing unauthenticated remote attackers to cause denial of service via malformed GBNF repetition rules, has been fixed in build b12604.

Key points

  • CVE-2026-137057 affects llama.cpp versions from b7118 up to but not including b12604.
  • The flaw is an integer underflow in the parse_sequence() function of the llama_grammar_parser.
  • Unauthenticated attackers can exploit this by sending GBNF repetition rules where the maximum value is lower than the minimum, such as {5,2}.
  • Exploitation causes the server process to hang and exhaust memory, resulting in a denial of service.
  • The vulnerability is rated 8.7 High on CVSS 4.0 and 7.5 High on CVSS 3.1.
  • The fix was released in build b12604, which adds validation to prevent invalid repetition counts.

Background

llama.cpp has a history of grammar-related vulnerabilities, including CVE-2026-134540, a medium-severity denial-of-service flaw fixed in build b12405, and CVE-2026-2069, a stack-based buffer overflow requiring local access. The current vulnerability was reported on November 18, 2026, and patched on November 21, 2026.

Why it matters

As an open-source inference server, llama.cpp is widely deployed in AI applications. A remotely exploitable denial-of-service vulnerability with no authentication requirement poses a significant risk to availability, potentially disrupting services that rely on the tool for language model inference.

What to watch

Users of llama.cpp should update to build b12604 or later to mitigate the vulnerability. No further action is required as the patch has been released.

Share this article

Want the full story? Read the original reporting

Read on CVEs | Zero Wire | Cloudflare Radar