CVE-2026-137057

high

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.

References

https://www.vulncheck.com/advisories/llama-cpp-b7118-before-b12604-integer-underflow-in-grammar-parser-parse-sequence

https://github.com/ggml-org/llama.cpp/releases/tag/b12604

https://github.com/ggml-org/llama.cpp/pull/32551

https://github.com/ggml-org/llama.cpp/issues/32550

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://euvd.enisa.europa.eu/vulnerability/EUVD-2026-135711

Details

Source: Mitre, NVD

Published: 2026-11-25

Updated: 2026-11-25

Risk Information

CVSS v2

Base Score: 7.5

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P

Severity: High

CVSS v3

Base Score: 7.5

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Severity: High

CVSS v4

Base Score: 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

Severity: High

EPSS

EPSS: 0.01269