By Hamza Faisal
Five AI models hosted on Hugging Face were carrying a Windows remote access trojan and poisoned chat templates, and they were downloaded 2,428 times before anyone noticed. The findings, published on November 27 by security researcher Root0ne through the Malspark project, expose a supply-chain blind spot in the way millions of developers download and run open-weight models on their own machines.
The scan covered every one of the 3,273,389 public model repositories on Hugging Face on November 26, including 226,310 GGUF repositories holding 2.56 petabytes of weights. Only five repositories were malicious, but they had already been pulled thousands of times, and the count was still climbing when the report landed.
A trojan hiding where loaders never look
The largest campaign, run by an account called Mir2k, uploaded two “uncensored” models on November 22 and 24. Each file carried an 11.47 MB Windows program called “ollie” tucked behind the last tensor in the GGUF file — a region that runtimes such as llama.cpp, LM Studio and Ollama never read, so the trojan changes nothing about how the model answers and triggers no warning. One copy was padded with about half a megabyte of junk data; the other was compressed with raw Deflate so no file signature survived.
The implant is a full remote access trojan. According to Malspark’s analysis, it checks for virtual machines and analysis tools before continuing, persists through scheduled tasks, watchdog processes and registry keys, and reaches its operator over a Tor onion service. About 10.25 MB of its size is a bundled Tor client. Antivirus engines and pickle scanners did not flag the live files in the researcher’s tests.
Poisoned templates did the triggering
The trojan on its own is inert — a GGUF loader never executes the bytes after the last tensor. The trigger was the chat template, the small Jinja2 program stored in a model’s metadata that formats every conversation before the model reads it. On November 26, Mir2k rewrote both models’ templates — twice, about nine hours apart — so the model opens every reply with a single fixed PowerShell line. Run that line, and it unpacks and executes the hidden program.
The second campaign, run by an account called timdedid, took aim at AI agents instead. It published three identical copies of a Qwen3 1.7B model pitched at security users on November 21 and 22. Their templates inject a fake system-directive block whenever a user message contains a trigger phrase such as “What is” — a hijack aimed at agent harnesses with shell access, where a fetched script can be executed automatically. Malspark could not recover the second stage of that attack.
One copy is still live — and a free scanner can catch it
Hugging Face has since disabled all five repositories for breaching its content policy, and neither account shows any public model. But the download counters kept rising until the takedown — an independent check on Saturday put the total at 2,807 — and a copy of one timdedid model was still live on Ollama’s public library with its trap intact. Download counts record pulls, not people, so 2,428 is an upper bound on how many users are affected.
The researcher has released gguf-radar, a free open-source scanner that checks both the trailing bytes and the chat template without running anything, and can rebuild a clean GGUF file with the weights untouched. Until scanning becomes routine, the advice is simple: treat any command a community model prints as untrusted, never paste it into a shell, and pin a reviewed chat template before loading an unfamiliar model.



