llama.cpp b10398 before b11301 Integer Overflow in gguf_init_from_reader
Impact
llama.cpp b10398 before b11301 contains an integer overflow vulnerability in gguf_init_from_reader that allows attackers to bypass tensor element-count validation by supplying shapes whose product wraps to zero. Attackers can craft GGUF files with enormous tensor extents that overflow ggml_nbytes() and strides, causing out-of-bounds memory access when buffers are sized from wrapped byte counts.
Source excerpt · VulnCheckAffected packages
Affected products
Vendor version evidence. Product records are separate from automatic dependency matching.
ggml-org · llama.cpp
Other versions: unaffected
| Version / range | Source status |
|---|---|
| b10398 to before b11301 | affected |
| 0.1.0 to before 0.6.0 | affected |
Original source description
llama.cpp b10398 before b11301 contains an integer overflow vulnerability in gguf_init_from_reader that allows attackers to bypass tensor element-count validation by supplying shapes whose product wraps to zero. Attackers can craft GGUF files with enormous tensor extents that overflow ggml_nbytes() and strides, causing out-of-bounds memory access when buffers are sized from wrapped byte counts.
References
- Source reference github.com/ggml-org/llama.cpp/issues/29383
- Patch github.com/ggml-org/llama.cpp/pull/29384
- Patch github.com/ggml-org/llama.cpp/commit/2149c00f4442dc59302e134a02e4c99d5f7ed9fc
- Source reference github.com/ggml-org/llama.cpp/blob/v0.5.0/ggml/src/gguf.cpp
- Release notes github.com/ggml-org/llama.cpp/releases/tag/b11301
- Security advisory www.vulncheck.com/advisories/llama-cpp-b10398-before-b11301-integer-overflow-in-gguf-init-from-reader