Downloads · 30 days
0
htdy7703/gguf-t5-precompiled-charsmap-oob-poc
gguf-t5-precompiled-charsmap-oob-poc is a machine learning model from htdy7703. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository proves a narrow claim: loading a crafted T5 GGUF whose tokenizer.ggml.precompiledcharsmap metadata is only 1 byte long triggers a heap-buffer-overflow during tokenizer initialization in llama.cpp.
Downloads · 30 days
0
Access
Public
Updated Jul 7, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md1.8 KB · 30%
From the Hugging Face model README
This repository proves a narrow claim: loading a crafted T5 GGUF whose tokenizer.ggml.precompiled_charsmap metadata is only 1 byte long triggers a heap-buffer-overflow during tokenizer initialization in llama.cpp.
What this PoC shows:
What this PoC does not show:
Verified commit:
95e5254c0ae93529b2f6c05e210b9cac5c0070fcbuild_malicious_t5_charsmap.py: helper to generate t5-precompiled-charsmap-oob.gguf from a local llama.cpp checkoutpoc_vocab_only_loader.cpp: minimal vocab-loading harness using product codebuild_stubs.cpp: small helper stubs needed by the reduced harness buildpython3 build_malicious_t5_charsmap.py /path/to/llama.cpp ./t5-precompiled-charsmap-oob.gguf
That helper imports gguf-py from the provided llama.cpp checkout and therefore expects its Python dependencies to be available. It writes a GGUF with:
general.architecture = "t5"tokenizer.ggml.model = "t5"tokenizer.ggml.precompiled_charsmap = b"\\x41"First generate t5-precompiled-charsmap-oob.gguf with the helper above. Then build a small ASAN-instrumented loader from product sources together with poc_vocab_only_loader.cpp and build_stubs.cpp, and run it against t5-precompiled-charsmap-oob.gguf.
The expected result is an AddressSanitizer report showing:
ERROR: AddressSanitizer: heap-buffer-overflowREAD of size 4llm_tokenizer_ugm::llm_tokenizer_ugm