You need to agree to share your contact information to access this dataset
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This repository contains a security proof-of-concept for a vulnerability in llama.cpp. Access is restricted to authorized security researchers and the affected maintainers. Please provide your reason for requesting access.
Log in or Sign Up to review the conditions and access this dataset content.
PoC: Heap-Buffer-Overflow Read in llama.cpp Vocab Loading
Vulnerability: Heap-buffer-overflow read in llama_vocab::impl::load() via crafted GGUF with mismatched tokenizer.ggml.scores / tokenizer.ggml.tokens array sizes.
Affected software: llama.cpp (confirmed on commit 2b089c7, tag b8083)
Bug class: CWE-125 (Out-of-bounds Read)
Trigger path: vocab_only = true (default for llama-tokenize and tokenization-only workflows)
Files
| File | Description |
|---|---|
poc_vocab_oob.py |
Generates the minimal crafted GGUF file (1,651 bytes) |
reproduce.sh |
One-command reproduction: clone, build with ASAN, generate PoC, run |
SUBMISSION.md |
Full vulnerability writeup with root cause analysis and suggested fix |
Quick Reproduction
chmod +x reproduce.sh
./reproduce.sh
This will:
- Clone llama.cpp at the affected commit
- Build
llama-tokenizewith AddressSanitizer - Generate the crafted GGUF file via
poc_vocab_oob.py - Run
llama-tokenizeand display the ASAN heap-buffer-overflow report
Root Cause
The vocab loader retrieves tokenizer.ggml.tokens and uses its length (n_tokens = 100) as the loop bound. It obtains scores and toktypes as raw pointers via gguf_get_arr_data() without verifying those arrays contain at least n_tokens elements. When the crafted file provides 100 tokens but only 1 scores entry, the loop reads 396 bytes past the end of the scores heap allocation.
Responsible Disclosure
This PoC is provided under responsible disclosure. Do not use it against systems you do not own or have authorization to test. Access is gated to authorized researchers only.
- Downloads last month
- 5