Hidden malware found in five GGUF models on Hugging Face
Most people who run local AI models download them as GGUF files. According to the report, a scan of all public Hugging Face repositories on 26 November found five GGUF models carrying malicious code. By 27 November those files had been downloaded 2,428 times. Hugging Face counts downloads rather than people, so the number of affected users is lower or equal to that figure.
At the heart of the problem is the chat template that every GGUF file carries. The runtime applies this template before each reply to decide what text the model actually reads. According to the article, attackers alter the template to add instructions the user never sees. The model answers normally, but behind the scenes it is nudged to make an agent run a command, or to prepend every reply with a line the user may copy and execute. In the strongest form, the malicious program sits inside the model file itself, appended past the last section that loaders ever read.
The largest campaign, called Mir2k, uploaded two uncensored GGUF models and hid a Windows remote access trojan named ollie at the end of each file. On 26 November both templates were rewritten so the model asks the user to run the line that unpacks the malware.
According to the report, an open-source tool called gguf-radar can detect these templates and the hidden bytes without running anything, and can rebuild a clean GGUF file with the model weights unchanged. The advice is to scan local .gguf files with such tools rather than relying on antivirus checks that only inspect the last few kilobytes, because the compressed payload can slip past them.