Description
A flaw has been found in ggml-org llama.cpp up to 55abc39. Impacted is the function llama_grammar_advance_stack of the file llama.cpp/src/llama-grammar.cpp of the component GBNF Grammar Handler. This manipulation causes stack-based buffer overflow. The attack needs to be launched locally. The exploit has been published and may be used. Patch name: 18993. To fix this issue, it is recommended to deploy a patch.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| ggml-org | llama.cpp | 55abc39 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | llama.cpp | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | llama.cpp | No fix yet | — |
| Ubuntu 26.04 LTS | llama.cpp | No fix yet | — |
| Ubuntu 25.10 | llama.cpp | No fix yet | — |
References
- VDB-344636 | ggml-org llama.cpp GBNF Grammar llama-grammar.cpp llama_grammar_advance_stack stack-based overflow vdb-entry technical-description
- VDB-344636 | CTI Indicators (IOB, IOC, IOA) signature permissions-required
- Submit #745263 | llama.cpp commit 55abc39 Stack-based Buffer Overflow third-party-advisory
- https://github.com/ggml-org/llama.cpp/issues/18988 issue-tracking
- https://github.com/ggml-org/llama.cpp/issues/18988#event-4426704865 issue-tracking
- https://github.com/user-attachments/files/24761101/poc.zip exploit
- https://github.com/ggml-org/llama.cpp/pull/18993 issue-tracking patch
- https://github.com/ggml-org/llama.cpp/ product