Five Models on Hugging Face Hid Malware in Plain Sight

4 min read

Local models felt safe. You download a file, you run it offline, and nothing phones home. That idea took a hit on 27 November 2026, when security researcher Root0ne published a Malspark report about five GGUF models on Hugging Face that carried real malware.

The scan covered 3,273,389 public model repositories, including 226,310 GGUF repos. It parsed 572,184 chat templates without running any of them. Five models came back malicious, with 2,428 downloads between them as of 27 November. Hugging Face counts downloads, not people, so the number of affected users is at most that. The count had been 1,502 a day earlier, so the files were still spreading while the report went out.

The attack worked in two halves, and neither half touched the model weights. The models answered questions normally. A quality test would pass. The malware sat in places most of us never look.

Hiding place one was the chat template. Every GGUF file carries a small Jinja2 program under the metadata key tokenizer.chat_template. Your runtime runs it before every reply to build the exact text the model reads. The template is code you never reviewed, and what it adds never shows up in your chat window. One account, timdedid, published three copies of a small Qwen3 model. When a message contained the words "What is", the template slipped in a fake system directive telling an agent with shell access to download a script and run it in a hidden window. The other account, Mir2k, went further. Its template told the model to open every reply with a single PowerShell line.

Hiding place two was the end of the file. A GGUF header says exactly where the model data ends. Loaders read only those bytes and ignore the rest, so an attacker can append a whole program there and nothing warns you. Mir2k hid an 11.47 MB Windows remote access trojan called ollie after the last tensor. One copy was plain, with half a megabyte of filler after it so a quick tail scan sees nothing. The other was compressed with raw Deflate, which strips every file signature. The PowerShell line from the poisoned template read those hidden bytes back out of the model file and started them.

Once running, ollie stole saved browser passwords and crypto wallet data, logged keys, took screenshots, and mined Monero over Tor. The two halves were even staged. Mir2k uploaded the first model on 22 November with a clean template, and the second on 24 November the same way, then swapped in the poisoned templates on 26 November.

The runtimes did nothing wrong. llama.cpp, Ollama and LM Studio read exactly the bytes the header points to, and no CVE is involved. The attack relied on trust. A model file is software, and we have been treating it like data.

The fix is boring, which is good news. Download from the publisher, not from a look-alike account. Read the chat template before you load a file. Check for bytes past the last tensor. Pin the file hash you tested. And never run a command a model prints without reading it first. The model file is now part of your supply chain. Treat it that way.

Downloads of the five poisoned models, 27 Nov 2026
Huihui-Qwen3.5-9B1488downloadsInkling-2-Mini458downloadsqwen3.8-cyber271downloadsqwen3-cyber-2136downloadsqwen3-cyber75downloads
Data from the sources listed below.

The two Mir2k models took most of the downloads.

Try this

Scan any GGUF file before you load it. gguf-radar is the open source scanner Malspark released with the report. It checks the chat template and the bytes after the last tensor without running anything. Exit code 0 means clean, 2 means suspicious or malicious, and 1 means an error.

bash
pip install git+https://github.com/Root0ne/gguf-radar
gguf-radar scan ./model.gguf
gguf-radar scan Qwen/Qwen2.5-0.5B-Instruct-GGUF
gguf-radar sanitize suspicious.gguf -o clean.gguf

Sources