Skip to content
DayZeroHub
High Not yet writtenCVSS 8.7CVE-2026-137057

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

ggml-org llama.cpp

Preliminary notice: published right away from the original source data, without editorial write-up. It will shortly be replaced by a written and reviewed version.

Summary

CVE-2026-137057: high-severity vulnerability (CVSS 8.7) in ggml-org llama.cpp.

What happened

Original description from the source: 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.

Why it matters

High severity, CVSS 8.7.

Affected products and versions

ggml-org llama.cpp >= b7118, < b12604

ProductVersionsFixed in
ggml-org llama.cpp>= b7118, < b12604—

Action recommended by the source

See the official references for the fix or mitigation.

Information taken from the source or the vendor. Verify it at the original link before acting.

Sources and references

Weaknesses (CWE): CWE-191

Relevant change history

  1. Published

    Preliminary advisory published.