Downloads · 30 days
37
16% of all-time downloads
rajasingh010/ollama-gguf-dos-2
ollama-gguf-dos-2 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: readString() Type: Denial of Service (Integer Overflow → OOM)
Downloads · 30 days
37
16% of all-time downloads
All-time downloads
238
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: readString()
Type: Denial of Service (Integer Overflow → OOM)
readString() reads a uint64 string length from the GGUF file and casts it to int
for the bounds check. When the uint64 has the sign bit set (≥ 2^63), the cast
produces a negative int, bypassing the bounds check entirely.
func readString(f *File) (string, error) {
n, err := read[uint64](f) // n = 0x8000000000000000
if int(n) > len(f.bts) { // int(0x8000000000000000) = -9223372036854775808
f.bts = make([]byte, n) // make([]byte, 2^63) → OOM panic!
}
...
}
With string_length = 0x8000000000000000 (2^63):
int(0x8000000000000000) = -9223372036854775808 (negative!)make([]byte, 2^63) → Go runtime panic: allocation too largecurl -X POST http://localhost:11434/api/create -d @malicious_gguf_overflow.gguf
# Result: OOM panic → service crash
if n > 1<<30 {
return "", errors.New("string length exceeds limit")
}