Malware hidden in local AI models on Hugging Face: downloaded over 2,400 times
Security researcher Düzgün found five infected local AI models on Hugging Face, downloaded over 2,400 times combined. The files concealed Windows malware and tampered chat templates.

Explained in 30 seconds
- Malspark researcher Düzgün (@Root0ne) scanned all 3,273,389 public Hugging Face repositories and uncovered five malicious GGUF models.
- The infected files reached 2,428 downloads before Hugging Face disabled the accounts, though copies surfaced elsewhere.
- Attackers appended the 11.47 MB Windows trojan ollie past the model data and poisoned chat templates to launch scripts via PowerShell.
On November 26, security researcher Düzgün – known online as @Root0ne – scanned all 3,273,389 public model repositories on Hugging Face. During the sweep, the founder of security firm Malspark uncovered five infected models in the GGUF format, a popular, compact file type used to run AI locally on home computers. Before Hugging Face disabled the offending accounts, those files had already been downloaded 2,428 times combined. For anyone running tools like Ollama or LM Studio on their own machine, it is a stark reminder that local AI isn't automatically safe.
In total, Düzgün inspected more than 226,000 repositories holding these local model files, totaling 2.56 PB of data – roughly 2.5 million GB. When you pull down an open-source AI model, you naturally assume the file holds nothing more than harmless numbers. "While scanning 3.27 million public model repositories, I found five GGUF models with hidden malware that were downloaded over 2,400 times," he writes in his Malspark research report.
How one ordinary-looking model file sneaks malware onto your PC
The attackers relied on two different tricks to infect machines. In the first method, tracked as the Mir2k campaign, they tacked a separate Windows remote access trojan onto the very end of the file, past the actual AI data. That hidden payload – an 11.47 MB trojan called ollie – packed a cryptominer to silently mint digital coins alongside a covert Tor connection to fetch fresh commands. Because local AI apps stop reading once the model data ends, the chatbot keeps running without a hitch. Oversized model files often sail right past standard antivirus scanners, too.
The second trick is just as sneaky and showed up in both the Mir2k and timdedid campaigns. Here, attackers tampered with the model's built-in chat template, which dictates how your prompts and the AI's replies are structured. The moment you load an altered language model, it slips in hidden instructions telling Windows PowerShell to run external scripts or launch that hidden trojan. Whenever a local AI agent runs autonomously with permission to execute commands on your system, a single poisoned file can cause real damage.
| Attack method | How the infection works | Key risks | How to protect yourself |
|---|---|---|---|
| Hidden payload at the end | Windows trojan ollie (11.47 MB) glued past the AI weights | Remote intrusion, cryptomining, and Tor backdoor | Scan links beforehand with gguf-radar and strip trailing bytes |
| Poisoned chat template | Malicious command hidden inside the chat formatting rules | AI agent launches external scripts via PowerShell | Inspect templates and lock down agent permissions |
| Circulating copies | Infected files resurface outside Hugging Face | Antivirus tools often skip huge model files | Download only from trusted publishers and scan first |
Even seasoned developers were caught off guard: why local AI agents face extra risk
On November 28, the findings quickly drew heavy attention on ExplainX AI and tech forum Hacker News. Many developers running AI on their own hardware had assumed a model file only holds static math. "I had no idea this was even possible, I thought that model files were strictly containers for weights and tensors," one surprised Hacker News commenter wrote. Other participants stressed that the only real defense is locking an AI agent inside a strict sandbox on your computer, regardless of what text or commands a model outputs.
How to scan an AI model beforehand with gguf-radar
Although Hugging Face pulled all five malicious repositories offline, copies briefly resurfaced elsewhere, including in Ollama's public library. To help users stay ahead of the threat, Düzgün immediately released a free open-source tool called gguf-radar on GitHub. It lets you check a Hugging Face link before downloading massive files to your drive. Already have models saved locally? The same utility strips out suspicious trailing bytes or tampered chat templates without hurting the AI itself. If you run Ollama or LM Studio at home, stick to trusted publishers, scan unfamiliar files first, and never hand a local AI agent unrestricted access to your PC.
What does this mean for you?
Running AI at home with Ollama or LM Studio? Don't assume a model file is harmless—scan unfamiliar links first with gguf-radar and never give local AI agents unrestricted access to your PC.
Are developers or staff testing local AI models? Allow files only from verified publishers, scan downloads beforehand, and isolate local AI agents from company folders.
How can a local AI model carry a virus?
Attackers glue standard malware onto the end of the model file or hide commands inside its chat template. Local AI software only reads the first section for the model itself, so the chatbot still appears to work normally.
Are all models on Hugging Face unsafe now?
No. Out of more than 226,000 local model repositories scanned on Hugging Face, only five were infected. Still, copies occasionally pop up on other sites, so checking files from unfamiliar creators remains smart.
How can I check a model file before opening it?
With Düzgün's free gguf-radar tool, you can inspect a Hugging Face link before downloading the full file. It can also strip suspicious trailing bytes or tampered chat templates out of models already on your drive.
- Malicious GGUF Models on Hugging Face (Malspark)Primary source
- gguf-radar: GGUF security scanner and sanitizer (GitHub (@Root0ne))Primary source
- GGUF Malware on Hugging Face: Hidden Payloads and Chat Template Poisoning (ExplainX AI)Media
- GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims (Hacker News)Community
How to run AI locally on your PC or Mac with Ollama — without cloud subscriptions
Free apps like Ollama and LM Studio run capable open-weight models like Gemma 4 offline on your own desk. Here is what your RAM can realistically handle and how to start.
Privacy, Safety & EnvironmentIs AI bad for the environment? Hard numbers on electricity, water, and data centers
A single text chat burns only tiny fractions of energy and roughly five drops of water, yet billions of daily prompts and AI videos put real pressure on local power grids.