Malicious GGUF Models on Hugging Face (2026): The Hidden Windows Trojan, Hijacked AI Agents and How to Check Your Files

Jump to comments

The Hugging Face website on a laptop screen, with its yellow smiling-face logo enlarged under a magnifying glass
The Hugging Face website seen through a magnifying glass on a laptop screen.
Photo: Jernej Furman, 2023, via Wikimedia Commons (CC BY 2.0)

The short answer: A security researcher scanning every public model on Hugging Face found five GGUF files, the format most people use to run AI models on their own computers, that were built to attack the people who downloaded them. Two "uncensored" models carried a Windows remote-access trojan hidden after the end of the model weights, with a chat template that tells the model to print the command that unpacks it. Three others carried a template that orders a coding agent to download and run a PowerShell script. Hugging Face has now disabled all five, but the files had been downloaded 2,807 times by Saturday afternoon, and one copy was still listed on Ollama.

The report, published on Nov. 27 by Düzgün, the researcher behind the Malspark security site, spread quickly through the local-AI community over the weekend. On X, posts about Hugging Face and malware mostly ran at 70 to 140 a day during the week, then passed 700 on Nov. 28 alone. Here is what the files did, why ordinary scanners missed them, who is actually at risk and how to check the models already on your disk.

What the scan found

Malspark scanned all 3,273,389 public model repositories on Hugging Face on Nov. 26, including 226,310 repositories that hold GGUF files, about 2.56 petabytes of weights. It did not download them in full. It read each file’s header and its last bytes over the network and parsed 572,184 chat templates without running any of them. After removing security test files, harmless persona prompts and research samples, five repositories from two accounts were left:

  • Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF: a Windows program appended after the weights; 1,488 downloads on Nov. 27, 1,711 by Nov. 28.
  • Mir2k/Inkling-2-Mini-Uncensored-GGUF: the same program, compressed; 458 downloads on Nov. 27, 574 by Nov. 28.
  • timdedid/qwen3.8-cyber-uncensored: agent-hijacking template; 271, then 288.
  • timdedid/qwen3-cyber-UNCENSORED-2: the same template; 136, then 151.
  • timdedid/qwen3-cyber-UNCENSORED: the same template; 75, then 83.

The Nov. 27 total in the report was 2,428. The Nov. 28 figures come from Hugging Face’s own model API, which we checked at about 2:50 p.m. Pacific; they add up to 2,807. Hugging Face counts downloads, not people, so the number of affected users can only be the same or lower. None of the five came from the original model makers. Both Mir2k uploads were repackaged copies of genuine open models, a community "abliterated" Qwen3.5 9B and Thinking Machines’ Inkling 2 Mini, an open-weights model released this month that is small enough to run on a 32GB laptop.

How the trap worked

Every GGUF file carries a chat template, a short program written in the Jinja language that the app running the model applies to each conversation. It turns your messages into the exact text the model reads. Whatever the template adds goes to the model, and none of it shows up in the chat window. The report sums up the trick in one line:

The model answers normally, while the template quietly adds instructions the user never sees.

Düzgün, Malspark report, Nov. 27, 2026

The Mir2k models: plant first, arm later

Mir2k is a new account, and the report found French traces throughout its uploads. On Nov. 22 it created 14 repositories. Twelve were empty placeholders named after models that don’t exist yet, such as Qwen4-27B, DeepSeek-V4, Llama-4-Scout and gemma-4-27b, apparently ready to be filled the moment people start searching for those releases. The Qwen3.5 model went up the same day with an executable already appended after its last tensor, the point where the weights end. The Inkling model followed on Nov. 24 with the same program compressed, which strips out every recognizable file signature. Both started with clean, normal templates, so for days the payload sat in the files with nothing to start it.

On the morning of Nov. 26, both templates were replaced within about an hour, and nine hours later they were replaced again. The final version adds a system message, in French, telling the model to begin every reply with one line "copied character by character" and then answer normally. That line is a PowerShell command. It finds the largest .gguf file in the user’s profile, cuts the hidden bytes out of the end, writes them to a file called d.exe in the Windows temp folder and starts it. The model never runs anything itself. The attack works only if a person copies the line it prints and runs it, which is exactly what someone trying to "fix" a strange first line might do.

The timdedid models: a trap for coding agents

The second account published three byte-identical copies of a small Qwen3 1.7B model aimed at security users on Nov. 21 and 22, plus a mirror on Ollama’s model library. Its template is the official Qwen3 template with one addition near the end. When the user’s latest message contains the words "What is," it inserts a fake "[SYSTEM DIRECTIVE]" ordering an AI agent to call its PowerShell tool, download a script from a WordPress site to a file in C:\Windows\Temp and run it in a hidden window. The README advised users not to replace the built-in template, which kept the trigger in place.

A plain chat window can’t run that command. The danger is an agent or coding tool that gives the model a shell on a Windows machine and runs tool calls without asking. The second-stage script was never recovered, so nobody outside the attackers knows what it would have installed.

What the hidden program does

Both Mir2k files unpack to the same 11.47 MB Windows program, which the researcher named "ollie." Most of that size, 10.25 MB, is a complete copy of the Tor client, which it uses to reach its operator through a hidden onion service. According to the report’s analysis, it first checks for VirtualBox, VMware and Sandboxie and for usernames like "sandbox" or "malware," and quits if it finds them. On a real machine it digs in: a scheduled task restarts it every 10 minutes with the highest privileges, two watchdog processes keep it alive, and its process is marked as critical, so killing it crashes Windows.

Once connected, it sends out passwords saved in Chrome, Edge and Brave, goes after the Phantom and MetaMask crypto wallet extensions, and supports keylogging, clipboard reading, screenshots, live screen streaming and webcam capture. When the computer is idle, it mines the Monero cryptocurrency. It keeps its files in a folder named "ollie" under AppData\Roaming, close enough to "Ollama" to look familiar at a glance. Not everything works: Chrome’s newest app-bound encrypted passwords are left undecrypted, and its attempt to bypass Windows’ admin prompt fails because the file paths were compiled without their backslashes.

As an Amazon Associate, Aglena earns from qualifying purchases.

Why the usual checks missed it

A GGUF file tells the loader exactly where the model data ends, and apps such as llama.cpp and LM Studio read only those byte ranges. Anything after the last tensor is never read, doesn’t change how the model behaves and triggers no warning. The Safetensors format, by contrast, refuses a file whose declared tensors don’t fill it exactly, so this half of the trick is specific to GGUF. The template half is not: Safetensors and PyTorch models carry the same kind of template in a separate file.

The llama.cpp web chat interface in dark mode, showing the question "What is the best wiki?" and a locally run Qwen3.5 GGUF model's answer listing Wikipedia, Fandom and Wikidata
The llama.cpp web interface answering a question with a Qwen3.5 GGUF model running on the user’s own computer.
Screenshot: Georgi Gerganov and the GGML authors, 2026, via Wikimedia Commons (public domain)

Hugging Face does scan uploads. Its documentation says every file under 2 GB goes through a malware scanner on each commit, and it runs a separate scanner for risky Python pickle files. In the report’s own tests, though, antivirus and pickle scanners raised no alert on the live Mir2k files, and GGUF parsers loaded them normally. The compressed payload in the Inkling file has no file signature for an antivirus engine to recognize, and the uncompressed one is followed by about half a megabyte of filler, so a tool that checks only the last few kilobytes sees nothing.

None of the pieces is brand new. Pillar Security showed hidden instructions in GGUF chat templates in 2025, a February 2026 paper tested template backdoors across 18 models and four inference engines, and the 2021 EvilModel study hid malware inside neural network weights. What the Malspark report adds is the method seen in real uploads on the largest public model hub, including a payload planted first and switched on days later.

Hugging Face pulled them; one copy lingers on Ollama

By Saturday, Hugging Face’s API listed all five repositories as disabled, and searching for models by either account returned nothing. Both Mir2k repositories show a last change at about midnight Pacific time on Nov. 28; because they are disabled, the change itself can’t be seen. We found no public explanation from Hugging Face by Saturday afternoon. The download counters kept climbing after the report, from 2,428 to 2,807.

The takedown did not reach every mirror. The timdedid model’s copy on Ollama’s public library, "timdedid/qwen3-1.7b-cyber," was still listed on Saturday afternoon with 84 downloads, up from 53 that morning according to the tech site sysnote, which pulled the file’s header and confirmed it carries the same "What is" trigger. We are not linking to it.

Am I affected?

How do I know if I downloaded one?

Search your model folders, such as the Hugging Face cache and LM Studio’s models folder, for anything published by Mir2k or timdedid, and run "ollama list" to see whether timdedid/qwen3-1.7b-cyber is installed. Only Windows machines are at risk from the ollie program, and only an agent with a Windows PowerShell tool can act on the timdedid directive.

I downloaded one but never ran a command it suggested. Am I safe?

Most likely. Copies of the Mir2k models downloaded before Nov. 26 contain the payload but not the template that unpacks it, and the program can’t start unless someone runs the printed line. Delete the files anyway. If an agent tool with shell access ever loaded a timdedid model, check that tool’s command history for a download from an unfamiliar WordPress site.

What if I ran the line?

Treat the computer as compromised. Disconnect it from the network, and from a different, clean device change the passwords saved in Chrome, Edge and Brave, starting with email and banking, and turn on two-factor sign-in. Move any crypto held in Phantom or MetaMask to a new wallet with a new recovery phrase, because the old one may be exposed. Because ollie hides behind watchdogs and a critical process, the safest fix is to back up your documents and reinstall Windows. The Malspark report lists file hashes and other indicators that a security tool or IT team can search for.

How can I check a model before I run it?

Read the template. Hugging Face’s file page includes a GGUF metadata viewer that shows the "tokenizer.chat_template" field, and for a local file the gguf Python package from the llama.cpp project reads it without loading the weights. Look for anything that mentions PowerShell, downloads, file paths or orders the model to start its reply with a command. The researcher’s free, open-source gguf-radar tool scans local files and Hugging Face links for poisoned templates and hidden bytes and can rebuild a clean copy with the weights unchanged; early users on Reddit reported false alarms on ordinary files, so treat a warning as a reason to look closer, not proof of infection.

If you run models with tools, take the embedded template out of the loop: llama.cpp accepts a reviewed template with "–chat-template-file," and an Ollama Modelfile can set its own TEMPLATE. Prefer files from the original model maker or well-known quantizers over brand-new accounts offering "uncensored" versions, and never let an agent run shell commands without approval.

What to watch

Hub rules. The report’s bluntest fix is for model hubs and apps to reject GGUF files with bytes after the last tensor or non-zero padding, and to scan templates for PowerShell loaders and hidden directives. Whether Hugging Face or Ollama adopt either is the first thing to watch.

The empty placeholders. Mir2k’s 12 placeholder repositories were named after models people will search for when they ship. The account no longer shows any models, but the same playbook can be run from a new name.

The next hiding places. The researcher also showed, with synthetic test files, three other spots in a GGUF file that can carry data without changing a single weight: oversized alignment padding, a ZIP archive appended so the file also imports as Python code, and blocks of weights with a zero scale. None has been seen in a real attack yet.

The unknown second stage. The timdedid script was never recovered, so it is still unclear what any agent that obeyed the directive actually installed. If a copy surfaces, that answer will matter most to developers who wire local models into coding tools.

Further reading

NVIDIA Jetson Orin Nano Super developer kit board with its black heatsink and fan
NVIDIA Jetson Orin Nano Super Developer Kit

A small, separate AI computer for testing local models away from the machine that holds your passwords and wallets.

Samsung 990 PRO 2TB M.2 NVMe solid-state drive with a black label
Samsung 990 PRO 2TB NVMe SSD

Fast storage for a growing folder of multi-gigabyte GGUF files, so you can keep vetted copies instead of re-downloading.

Black Seagate Portable 2TB USB external hard drive
Seagate Portable 2TB External Hard Drive

A simple USB drive for backing up documents before you wipe and reinstall a computer you no longer trust.

Cover of Hands-On Large Language Models by Jay Alammar and Maarten Grootendorst
Hands-On Large Language Models by Jay Alammar and Maarten Grootendorst

A visual guide to how language models, tokenizers and prompts fit together, useful for understanding what a chat template does.

Cover of Countdown to Zero Day: Stuxnet and the Launch of the World's First Digital Weapon by Kim Zetter
Countdown to Zero Day by Kim Zetter

The story of Stuxnet, the classic case of malicious code hidden where nobody thought to look.

Aglena Best Of product picks

Leave a Comment

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

Scroll to Top
Aglena