Security Vulnerability Identified in GGUF Model Files

A security researcher has identified a method of malware distribution targeting users of Large Language Models (LLMs) via the Hugging Face platform. According to reports circulating on Reddit, a scan of 3.27 million public model repositories uncovered five GGUF-formatted models containing hidden malware. These compromised files have reportedly been downloaded more than 2,400 times.

The researcher, identified as Düzgün (Root0ne), claims that the vulnerability exploits the specific structure of the GGUF container format. Because a GGUF file’s header specifies exactly where model weights end, inference loaders typically do not read any data beyond that point. This allows an attacker to append an executable to the end of the file without affecting the model’s functionality.

Technical Execution and Mitigation

The reported attack vector utilizes the “chat template”—a small program contained within the GGUF metadata—to execute malicious instructions. The researcher states that the template can be programmed to instruct the model to print a specific command. This command, when executed by the user’s system, pulls the malicious bytes from the end of the file and runs them.

In response to these findings, the researcher has released “GGUF Radar,” an open-source tool hosted on GitHub designed to detect and remove these specific payloads. While the findings have been shared via social media and Reddit, independent verification of the exact number of victims or the full extent of the breach has not been provided in the current reports.

Industry Response and Safety Recommendations

The discovery has prompted discussions among AI practitioners regarding the necessity of sandboxing environments. Users on community forums have suggested that running AI agents within Docker sandboxes can mitigate risks by limiting internet access to a whitelist and preventing the model from accessing sensitive host data or API keys.

Security experts noted that the GGUF format is widely used because it is a single-file container designed for quantized models, making it highly convenient for consumers using llama.cpp-based inference engines. This convenience, however, appears to have been leveraged by attackers to hide malicious code within a format that is standard for local model distribution.

Current recommendations from community members include downloading models only from official, reputed providers and utilizing sandboxed environments to isolate the inference process from the host operating system.