Skip to content

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

HighCVSS 8.7 EPSS 1.3%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: yes · technical impact: partial
Technology
Ubuntu

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.

Upgrade path

3 packages: 1 fixed, 2 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/llama.cpp(Ubuntu 26.04) All versions No fix listed No fix yet
ubuntu/llama.cpp(Ubuntu 26.10) All versions No fix listed No fix yet
ggml-org llama.cpp >= b7118, < b12604 b12604 Fixed

Affected products

ProductAffected versionsFixed in
ggml-org llama.cpp >= b7118, < b12604 b12604
ubuntu/llama.cpp(Ubuntu:26.04) All versions No fix listed
ubuntu/llama.cpp(Ubuntu:26.10) All versions No fix listed

References