If you download AI models to run on your own computer, you probably assume the file you get is just a model. A security scan published this week shows that assumption is no longer safe. Five AI models hosted on Hugging Face, the world’s biggest hub for sharing machine-learning models, were carrying hidden malware and poisoned instructions — and they had been downloaded 2,428 times before anyone noticed.

The findings were published on November 27 by Malspark, the security research project of researcher Root0ne. The scan itself was enormous. On November 26, it covered all 3,273,389 public model repositories on Hugging Face, including 226,310 repositories in the GGUF format — the container format most people use to run large language models locally with tools like llama.cpp, Ollama and LM Studio. Together those files hold 2.56 petabytes of model weights. The scan also statically parsed 572,184 chat templates without executing any of them, reading file headers and tails with HTTP Range requests instead of downloading whole models.

After filtering out security test repositories, harmless persona prompts and research samples, five repositories remained. All five were still online on November 27. By November 28, Hugging Face’s API listed them as disabled — but the files people had already downloaded are still sitting on their disks.

The five models came from two accounts, and they used two different tricks. The bigger campaign, under the account name Mir2k, uploaded two uncensored-style models: Huihui-Qwen3.5-9B-abliterated-GGUF, with 1,488 downloads, and Inkling-2-Mini-Uncensored-GGUF, with 458 downloads. Hidden after the last tensor in each file was a Windows remote access trojan called “ollie” — an 11.47 MB Windows program, about 10.25 MB of which is an embedded copy of the Tor anonymity software. According to Malspark, the trojan checks whether it is running inside a virtual machine or sandbox and exits if it spots one, and it persists on the machine through a scheduled task.

The second campaign, under the account name timdedid, published three copies of a small Qwen3 model with names like qwen3-cyber-UNCENSORED. Together they had 482 downloads. These did not carry a hidden executable. Instead, their poison was in the chat template, aimed at AI coding agents with access to a computer’s shell.

To understand the attacks, it helps to know two things about the GGUF format. First, every GGUF file carries its own chat template — a small Jinja2 program stored under the metadata key “tokenizer.chat_template” — and the software running the model applies that template to every prompt. Second, a GGUF file’s header declares the exact byte offsets of every tensor, and runtimes like llama.cpp and LM Studio only read the byte ranges the header points to. Anything after the last tensor is simply ignored.

The attackers exploited both facts. In the Mir2k models, the chat template was rewritten so that the model opens every reply with a single PowerShell command. That command reads the hidden bytes back out of the model file on disk, inflates them in memory, and starts the trojan as a file in the Windows temporary folder. The model itself loads and chats normally, and no runtime warns about the extra bytes, because as far as the runtime is concerned, they do not exist. In one of the two files, the payload was also padded with roughly half a megabyte of filler, so a scanner that only reads the last few kilobytes of the file sees nothing. In the other, it was compressed, so file signatures disappear.

The timdedid models worked differently. Their templates waited for a trigger — a user message containing a phrase like “What is” — and then silently injected a fake “[SYSTEM DIRECTIVE]” block into the conversation. That block told any AI agent with shell access to download and run a script. The second-stage script itself was not recovered, but the mechanism is the point: the instructions never appear in the chat window, yet they steer the model — and any agent acting on its output — toward dangerous actions.

What makes the Mir2k campaign particularly sneaky is its timeline. The models were uploaded with clean templates first, building up downloads and trust. Then, on November 26, both templates were rewritten to arm the attack. Anyone who had already downloaded the model got the poisoned template the next time the file was refreshed, and anyone downloading after that date got the whole package at once.

It is important to be precise about the risk. The figure of 2,428 is a download count, not a victim count — Hugging Face counts downloads, not people, and at the time of the scan on November 26 the same repositories had 1,502 downloads. Simply loading the model weights into llama.cpp, Ollama or LM Studio does not automatically execute the hidden program. The attack needs a human to copy and run the PowerShell line the model prints, or a tool-enabled coding agent to act on the hidden template instructions. But that is exactly what these templates were designed to make likely: the model itself tells you to run the command, in every single reply.

Malspark has open-sourced a scanner called gguf-radar, released under the MIT licence, which checks both chat template logic and trailing bytes at the end of a file — even remotely on Hugging Face, using HTTP Range requests without downloading gigabytes of weights. It can also rebuild a clean GGUF file with the model weights unchanged. The researcher also reproduced three other hiding places in synthetic files — data in alignment padding, a GGUF and ZIP polyglot, and data in zero-scale Q8_0 blocks — to show how many corners of the format can conceal a payload.

The deeper lesson is about trust in the open-model ecosystem. Hugging Face hosts millions of models, most uploaded by strangers, and the whole point of running models locally is that you control them. This scan shows that control is partly an illusion: the file you download can contain instructions you never see, in a template you never read, pointing at bytes your runtime never checks. Until scanners like gguf-radar become a routine step before loading a model, the advice is simple — scan before you run, never copy a command a model prints into your terminal, and treat a model file with the same suspicion you would give any other executable downloaded from the internet.

Leave a Reply

Your email address will not be published. Required fields are marked *