How concerned should the AI community be about the discovery of malicious GGUF models on Hugging Face, such as the Mir2k campaign?
Malicious GGUF Models: Are Your Local LLMs at Risk?
A recent investigation into Hugging Face repositories has uncovered a new security threat involving malicious GGUF files. Researchers identified a campaign, specifically involving the entity 'Mir2k,' that utilized 'chat template poisoning' to manipulate model behavior. These attacks leverage the Jinja2 chat templates stored in GGUF metadata to inject hidden instructions, such as prompting users to execute PowerShell commands. Furthermore, the study found that attackers can append executable malware, like the 'ollie' Windows remote access trojan, to the end of the file without affecting the model's loading process in runtimes like llama.cpp or LM Studio. While the discovery of five malicious models out of millions is relatively small, the method of hiding payloads after the tensor data is particularly stealthy. Fortunately, the open-source tool gguf-radar has been developed to detect these hidden bytes and rebuild clean GGUF files. This discovery highlights a critical vulnerability in how local LLM enthusiasts interact with community-shared models, emphasizing the need for vigilant scanning and the adoption of tools designed to strip malicious metadata and appended payloads.
Options
- Extremely concerned; we need mandatory file validation for all GGUF uploads.
- Moderately concerned; tools like gguf-radar offer sufficient protection.
- Not very concerned; the scale of this specific campaign is too small to be a trend.
- Focused on responsibility; users must be trained to audit what they download.