hacnho/gguf-final-logit-softcapping-backdoor-poc overview
GGUF final logit softcapping output manipulation PoC This repository contains a benign security research proof of concept for a Huntr MFV report. The malicious…
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.final-logit-softcap-0.01.gguf | GGUF | GGUF | 589.1 MB | Download |
Model Details
Model README
---
library_name: gguf
tags:
- security
- model-file-vulnerability
- gguf
- llama-cpp
---
GGUF final_logit_softcapping output-manipulation PoC
This repository contains a benign security research proof of concept for a Huntr MFV report.
The malicious GGUF is the upstream Gemma4 tiny GGUF model with one non-tokenizer architecture metadata value changed:
gemma4.final_logit_softcapping: 30.0 -> 0.01
This value is loaded by llama.cpp into Gemma4 hyperparameters and applied to final logits during inference. With greedy sampling, the control model repeats prompt tokens, while the malicious model silently collapses generated tokens to <pad>.
Files:
gemma-4-1B-0.8B-tiny.Q2_K.final-logit-softcap-0.01.ggufreproduce.pyrequirements.txtbuild_poc.py
Control model:
- https://huggingface.co/mradermacher/gemma-4-1B-0.8B-tiny-GGUF/resolve/main/gemma-4-1B-0.8B-tiny.Q2_K.gguf
Reproduction:
python3 -m venv /tmp/gguf-softcap-poc
. /tmp/gguf-softcap-poc/bin/activate
pip install -r requirements.txt
curl -L -o control.gguf \
https://huggingface.co/mradermacher/gemma-4-1B-0.8B-tiny-GGUF/resolve/main/gemma-4-1B-0.8B-tiny.Q2_K.gguf
curl -L -o malicious.gguf \
https://huggingface.co/hacnho/gguf-final-logit-softcapping-backdoor-poc/resolve/main/gemma-4-1B-0.8B-tiny.Q2_K.final-logit-softcap-0.01.gguf
LLAMA_SIMPLE=/path/to/llama-simple python reproduce.py control.gguf malicious.gguf
modelscan -p malicious.gguf --show-skipped
Expected result:
- control
Hello:<bos>HelloHelloHello... - malicious
Hello:<bos>Hello<pad><pad><pad>... modelscan==0.8.8:No issues foundand the GGUF is skipped
Run hacnho/gguf-final-logit-softcapping-backdoor-poc with guIDE
Download guIDE — the AI-native code editor with local LLM inference and 69 built-in tools.
Source: Hugging Face · Compare models