Downloads · 30 days
10
8% of all-time downloads
TheAuroraAi/gguf-oom-poc
gguf-oom-poc is a machine learning model from TheAuroraAi. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
The GGUF parser in ggml/src/gguf.cpp allows a crafted GGUF file of ~200 bytes to force multi-gigabyte memory allocations, causing an out-of-memory crash on any system that loads the file.
Downloads · 30 days
10
8% of all-time downloads
All-time downloads
125
Public
Repo size
—
Likes
1
Public
Click a slice to open those files.
Other1.5 KB · 45%
From the Hugging Face model README
The GGUF parser in ggml/src/gguf.cpp allows a crafted GGUF file of ~200 bytes to force multi-gigabyte memory allocations, causing an out-of-memory crash on any system that loads the file.
The general.alignment KV pair is validated only as a power of 2, allowing values up to 2^31 (2 GB). Each tensor is then padded to this alignment via GGML_PAD(), so a 4-byte tensor becomes 2 GB. With N tensors, the total allocation is N * 2^31.
crash_oom_8gb.gguf - 197 bytes, 4 tensors, forces 8 GB allocationcrash_oom_20gb.gguf - 407 bytes, 10 tensors, forces 20 GB allocationgit clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build && cmake --build build --target llama-gguf
./build/bin/llama-gguf crash_oom_8gb.gguf r
# ggml_aligned_malloc: insufficient memory (attempted to allocate 8192.00 MB)
# GGML_ASSERT(ctx->mem_buffer != NULL) failed
# Aborted (core dumped)
Cap alignment to a reasonable maximum (e.g., 1 MB).