Be first to know. Be ready to defend.

Poisoned GGUF models on Hugging Face hid a password-stealing trojan and targeted AI agents

Illustration headed Poisoned GGUF models on Hugging Face. A terminal box describes the Mir2k trick: the file holds a model plus a hidden .exe; loaders never read the extra bytes; the template was armed on 26 November; replies start with PowerShell; the payload is the ollie RAT, 11.47 MB. A footer says if you ran it, isolate the machine, then rotate passwords. Chips read 5 repos, 2 accounts; 2,428 downloads; Scan your .gguf files.Illustration headed Poisoned GGUF models on Hugging Face. A terminal box describes the Mir2k trick: the file holds a model plus a hidden .exe; loaders never read the extra bytes; the template was armed on 26 November; replies start with PowerShell; the payload is the ollie RAT, 11.47 MB. A footer says if you ran it, isolate the machine, then rotate passwords. Chips read 5 repos, 2 accounts; 2,428 downloads; Scan your .gguf files.
On this page
  1. Campaign 1: Mir2k hid a trojan in the model file
  2. What ollie does
  3. Campaign 2: timdedid aimed at coding agents
  4. Where things stand
  5. What to do

A security researcher scanned every public model repository on Hugging Face and found five that were built to infect the people, or the AI agents, using them. Düzgün, the researcher behind Malspark, scanned 3,273,389 repositories on 26 November and published the results on 27 November. The five came from two accounts, Mir2k and timdedid, and had been downloaded 2,428 times. Hugging Face counts downloads, not people, so the number of affected users is at most that.

All five are GGUF files, the format most people use to run models locally with tools such as llama.cpp, LM Studio and Ollama. Both campaigns abused the chat template, a small program inside the file that the runtime applies to every conversation. The model still answers normally, so nothing looks wrong.

Campaign 1: Mir2k hid a trojan in the model file

A GGUF file’s header says exactly where the model data ends. Runtimes read only that far, so anything appended after the last tensor is never loaded and never triggers a warning. Mir2k used that gap to carry a whole Windows program.

How the Mir2k campaign worked. Step 1, on 22 and 24 November Mir2k uploaded models with a program appended after the last tensor and a clean chat template. Step 2, people downloaded them, and they worked normally because loaders never read the extra bytes. Step 3, on 26 November the chat template was swapped so the model must start every reply with one PowerShell line. Step 4, if the user runs that line, it finds the largest .gguf file, writes %TEMP%\d.exe and starts it. Step 5, the ollie remote access trojan takes over, stealing passwords, wallets, keystrokes, screen and webcam over Tor. Copies downloaded before 26 November carry the payload but not the trigger.How the Mir2k campaign worked. Step 1, on 22 and 24 November Mir2k uploaded models with a program appended after the last tensor and a clean chat template. Step 2, people downloaded them, and they worked normally because loaders never read the extra bytes. Step 3, on 26 November the chat template was swapped so the model must start every reply with one PowerShell line. Step 4, if the user runs that line, it finds the largest .gguf file, writes %TEMP%\d.exe and starts it. Step 5, the ollie remote access trojan takes over, stealing passwords, wallets, keystrokes, screen and webcam over Tor. Copies downloaded before 26 November carry the payload but not the trigger.

The account uploaded Huihui-Qwen3.5-9B-abliterated-GGUF on 22 November and Inkling-2-Mini-Uncensored-GGUF on 24 November, both with the program already inside and with clean templates. On 26 November it rewrote both templates, then rewrote them again nine hours later. The new templates add a hidden system message, in French, telling the model to open every reply with one PowerShell line.

That line doesn’t run by itself. A user has to copy and run it. If they do, it finds the largest .gguf file in their profile, reads the hidden bytes from its end, writes them to %TEMP%\d.exe and starts the program. The second model carried the same program compressed, so it had no recognisable file signature.

Mir2k also created 12 empty repositories on 22 November, named after expected releases such as Qwen4-27B, DeepSeek-V4 and gemma-4-27b, apparently ready to be filled when those models appear.

What ollie does

The program, called ollie, is an 11.47 MB Windows remote access trojan. Most of that is a bundled copy of Tor. According to Malspark’s analysis, it:

  • exits if it detects VirtualBox, VMware or Sandboxie, or usernames such as “sandbox” or “malware”;
  • runs every 10 minutes from a scheduled task, with two watchdog processes;
  • marks its process as critical, so killing it crashes Windows;
  • sends saved passwords from Chrome, Edge and Brave to its operator over a Tor onion service, though it can’t decrypt Chrome’s newer app-bound encrypted entries;
  • targets the Phantom and MetaMask wallet extensions;
  • logs keystrokes and the clipboard, takes screenshots, streams the screen and captures the webcam;
  • mines Monero over Tor when the machine is idle.

It keeps its files in a folder named ollie under AppData\Roaming, close enough to Ollama to look familiar.

Campaign 2: timdedid aimed at coding agents

The timdedid account published three identical copies of a small Qwen3 1.7B model on 21 and 22 November, aimed at security users, plus an Ollama mirror called timdedid/qwen3-1.7b-cyber. Each template is the official Qwen3 template with one addition. When a user’s message contains “What is”, it inserts a fake [SYSTEM DIRECTIVE] telling an agent to use its PowerShell tool to download a script, value.ps1, and run it in a hidden window. The model card even advises users not to replace the built-in template.

This attack needs no human to run anything if the model is driving an agent with shell access. Malspark couldn’t recover the script, so what it would have installed is unknown.

The five malicious repositories Malspark found, with downloads as of 27 November. Mir2k Huihui-Qwen3.5-9B-abliterated-GGUF, 1,488 downloads, RAT recovered. Mir2k Inkling-2-Mini-Uncensored-GGUF, 458, RAT recovered. timdedid qwen3.8-cyber-uncensored, 271, agent hijack. timdedid qwen3-cyber-UNCENSORED-2, 136, agent hijack. timdedid qwen3-cyber-UNCENSORED, 75, agent hijack. Downloads are not confirmed infections.The five malicious repositories Malspark found, with downloads as of 27 November. Mir2k Huihui-Qwen3.5-9B-abliterated-GGUF, 1,488 downloads, RAT recovered. Mir2k Inkling-2-Mini-Uncensored-GGUF, 458, RAT recovered. timdedid qwen3.8-cyber-uncensored, 271, agent hijack. timdedid qwen3-cyber-UNCENSORED-2, 136, agent hijack. timdedid qwen3-cyber-UNCENSORED, 75, agent hijack. Downloads are not confirmed infections.

Where things stand

When we checked on 2 December, Hugging Face’s API listed all five repositories as disabled. The Ollama mirror timdedid/qwen3-1.7b-cyber was still available, showing 477 downloads. We haven’t inspected its template.

Neither technique is new on its own. Researchers had shown poisoned chat templates and malware hidden in model weights in lab settings. Malspark says it found no earlier public report of them in real attacks on Hugging Face, or of a payload appended to a model and armed by a template days later. It released gguf-radar, an open-source tool that checks templates and hidden bytes without running the model, and can rebuild a clean file with the weights unchanged.

What to do

  • Search your model folders for the five repositories above and the timdedid/qwen3-1.7b-cyber Ollama model, and delete any copies.
  • Scan local .gguf files with gguf-radar, for example gguf-radar scan ./model.gguf. Malspark says antivirus tools and checks that read only the end of a file miss the compressed payload.
  • Never paste a command that a local model suggests without reading it.
  • For agents with tool access, use a template you’ve reviewed instead of the embedded one: --chat-template-file in llama.cpp, or TEMPLATE in an Ollama Modelfile. Require approval before an agent runs shell commands.
  • If a machine ran the PowerShell line, look for %TEMP%\d.exe and an ollie folder under AppData\Roaming. Isolate the machine and rebuild it rather than killing the process.
  • From a clean device, change the passwords saved in Chrome, Edge and Brave, and move any funds in Phantom or MetaMask to a new wallet.
  • Block technoarteng[.]com, the download domain in Malspark’s YARA rule for the timdedid templates, and load Malspark’s YARA rules into your scanning tools.