hacnho/gguf-bos-token-id-hidden-prefix-poc overview
GGUF bos token id Hidden Prefix PoC This repository contains a bounded security research proof of concept for a GGUF tokenizer metadata output manipulation iss…
Runs locally from ~589.1 MB disk (4 GB VRAM class GPUs with llama.cpp / guIDE).
Repository Files & Downloads
| File | Type | Quantization | Size | Link |
|---|---|---|---|---|
| gemma-4-1B-0.8B-tiny.Q2_K.bos-hello.gguf | GGUF | GGUF | 589.1 MB | Download |
Model Details
Model README
---
library_name: gguf
tags:
- security
- huntr
- gguf
- proof-of-concept
---
GGUF bos_token_id Hidden Prefix PoC
This repository contains a bounded security research proof of concept for a
GGUF tokenizer-metadata output manipulation issue in llama.cpp.
The malicious artifact changes:
tokenizer.ggml.bos_token_id = 9259
Token 9259 is the normal text piece Hello. When llama.cpp automatically
adds a BOS token during tokenization, the model file causes that hidden BOS
slot to become Hello instead.
Files
gemma-4-1B-0.8B-tiny.Q2_K.bos-hello.gguf: malicious GGUF artifactreproduce.py: verifier for tokenization, inference, and modelscan posture
Expected Result
Prompt:
world
Control tokenization:
[2, 12392]
Malicious tokenization:
[9259, 12392]
Control output:
<bos>worldworldworldworldworldworldworldworldworld
Malicious output:
Helloworldworldworldworldworldworldworldworldworld
The malicious file was tested with llama.cpp llama-simple and
llama-tokenize. modelscan==0.8.8 reported No issues found and skipped the
GGUF file.
Run hacnho/gguf-bos-token-id-hidden-prefix-poc with guIDE
Download guIDE — the AI-native code editor with local LLM inference and 69 built-in tools.
Source: Hugging Face · Compare models