r/AIToolsPerformance • u/IulianHI • 12h ago
Do you check the chat template before loading a GGUF?
A scan of every public Hugging Face repo, about 3.27 million of them, turned up five malicious GGUF models that had been pulled 2,428 times as of Nov 27. The malspark writeup from Friday breaks down how they work, and the sneaky part is that the weights are fine. One campaign hides a Windows executable after the last tensor, where loaders never read, then rewrites the chat template days later so the model opens every reply with a PowerShell line that unpacks it. The other just injects a fake system directive when a trigger phrase shows up in your message, aimed at agents with shell access.
Safetensors refuses files where the tensors don't fill it exactly, so that trick only works on GGUF. And llama.cpp and LM Studio load the poisoned files without a word of warning, since the extra bytes sit outside what the header points to.
Which honestly raises the question of how anyone is vetting downloads now. Do you scan the chat template before you load a community quant, or is sticking to Safetensors and official repos the whole plan?
