Downloads · 30 days
22
9% of all-time downloads
rajasingh010/ollama-gguf-dos-1
ollama-gguf-dos-1 is a machine learning model from rajasingh010. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
File: fs/gguf/gguf.go Function: readArrayData() Type: Denial of Service (Unbounded Memory Allocation / OOM)
Downloads · 30 days
22
9% of all-time downloads
All-time downloads
235
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md1.6 KB · 50%
From the Hugging Face model README
File: fs/gguf/gguf.go
Function: readArrayData()
Type: Denial of Service (Unbounded Memory Allocation / OOM)
Ollama's Go GGUF parser has no upper bound check on array length in readArrayData().
When reading array metadata, make([]T, n) is called with a uint64 n from the file,
without validating that n is within reasonable bounds.
func readArrayData[T any](f *File, n uint64) (s []T, err error) {
s = make([]T, n) // n attacker-controlled, no bounds check
...
}
With array_length = 0x100000000 (2^32) and uint64 elements:
# Upload malicious GGUF
curl -X POST http://localhost:11434/api/create -d @malicious_gguf_array_overflow.gguf
# Result: OOM panic → service crash
func readArrayData[T any](f *File, n uint64) (s []T, err error) {
if n > 1<<20 { // limit to ~1M elements
return nil, errors.New("array length exceeds limit")
}
s = make([]T, n)
...
}