GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims
First reported by Malspark ·
Malware can now be hidden within LLM files that users download and run locally.
Five malicious GGUF Large Language Model (LLM) files containing hidden malware were found on Hugging Face, accumulating 2,428 downloads. The primary campaign, known as Mir2k, embeds a Windows remote access trojan, 'ollie,' at the end of GGUF files. This malware is activated through the model's chat template, which is designed to prompt users to execute a command that unpacks and runs the malicious payload. A scan of over 3.27 million public Hugging Face model repositories identified these malicious models. The Mir2k campaign uploaded models with the trojan appended after the last tensor, and later updated the chat templates to instruct users to run a specific PowerShell command, effectively deploying the malware. Another campaign, 'timdedid,' utilized chat templates to hijack coding agents. The 'ollie' implant, a Windows remote access trojan, was confirmed in the Mir2k models. The tool 'gguf-radar' can detect these malicious templates and hidden bytes without executing the models, enabling the creation of clean GGUF files.
This discovery highlights a significant supply chain vulnerability for AI developers and users. The method of hiding malware within the GGUF file format, specifically appended after the model weights and activated via the chat template, circumvents traditional security scans that may only examine model weights or headers. The fact that the malicious templates were updated days after the initial model upload indicates a sophisticated attack strategy designed to infect users who may have already downloaded the model, posing a risk even to those who downloaded prior to the activation.
The widespread adoption of LLMs for various applications, including coding and content generation, makes this threat particularly concerning. Users downloading models from public repositories like Hugging Face are now at risk of unknowingly executing harmful code. The success of these attacks underscores the need for enhanced security measures within model repositories and the development of specialized tools like 'gguf-radar' for detecting and mitigating such threats, potentially leading to stricter vetting processes for uploaded models.
AI-written summary. May contain errors.