Someone uploaded a popular-looking uncensored model to Hugging Face with a trojan already bolted to the end of the file, waited four days, and then edited one small text field so the model would ask its own users to install the malware. No loader warned, and Malspark says its antivirus tests saw nothing.
In short: the Hugging Face GGUF malware found by Malspark is a set of five poisoned local LLM model files, downloaded 2,428 times by 27 November 2026, that used hidden chat-template instructions to get users or AI agents to run a command, in one campaign unpacking a Windows remote access trojan stored inside the model file itself.
- What is the Hugging Face GGUF malware?
- How big was the scan, and what did it find?
- How did the Mir2k campaign work?
- What does the ollie RAT do?
- How did the timdedid campaign target AI agents?
- Timeline: from upload to takedown
- Who is affected and how do you check exposure?
- How do you detect GGUF model malware?
- How do you mitigate it?
- How does this compare to earlier model-file attacks?
- What is still unknown?
- The bottom line
- Sources
What is the Hugging Face GGUF malware?
It is two campaigns, Mir2k and timdedid, that Malspark researcher Düzgün described on 27 November 2026 after scanning every public model repository on Hugging Face. Both abused the GGUF model format and its embedded chat template, and one also smuggled a full Windows executable inside the model.
GGUF is the file format most people use to run large language models locally with tools such as llama.cpp, LM Studio and Ollama. A GGUF file holds a header, a metadata table, a tensor table and then the model weights. One metadata field, tokenizer.chat_template, holds a small Jinja2 program that formats every conversation before the model sees it.
This is not the first time a developer tool became a malware carrier this month. We covered fake AI coding-agent skills in the TrojanPony campaign two days earlier. The difference here is that the malicious content sits inside the model file, the one artifact most people assume is just numbers.
How big was the scan, and what did it find?
Malspark says it scanned 3,273,389 public model repositories on 26 November 2026, including 226,310 GGUF repositories holding 2.56 PB of weights, and parsed 572,184 chat templates without executing them. It read only file headers and file ends through HTTP range requests, so no model was downloaded in full.
After manual review removed security test repositories, harmless persona prompts and research samples, five repositories were left:
| Repository | Campaign | Method | Downloads (27 Nov) |
|---|---|---|---|
| Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF | Mir2k | Reply prefix plus hidden executable | 1,488 |
| Mir2k/Inkling-2-Mini-Uncensored-GGUF | Mir2k | Reply prefix plus compressed executable | 458 |
| timdedid/qwen3.8-cyber-uncensored | timdedid | Agent tool hijack | 271 |
| timdedid/qwen3-cyber-UNCENSORED-2 | timdedid | Agent tool hijack | 136 |
| timdedid/qwen3-cyber-UNCENSORED | timdedid | Agent tool hijack | 75 |
| Total | 2 actors | 2,428 |
Malspark stresses that downloads are not people, so the number of affected users is equal or lower. The count also grew fast: the same five repositories had 1,502 downloads at scan time on 26 November, and i10x reported the counters at 2,807 on 28 November, just before takedown.
How did the Mir2k campaign work?
Mir2k planted the payload first and armed it later. That delay is the detail that makes this campaign different from earlier proof-of-concept research.
Planting a trojan after the last tensor
The GGUF header defines exactly where model data ends. Runtimes read only those byte ranges, so anything appended after the final tensor is never loaded, never changes model behaviour, and triggers no warning. Malspark says Mir2k used this gap to carry a complete Windows program.
The first model, an “abliterated” build of Huihui-Qwen3.5-9B, carried a plain executable followed by about half a megabyte of filler, so a scanner that checks only the last few kilobytes of a file sees nothing. Abliteration is a technique that strips a model’s refusal behaviour, which is why such builds attract users looking for uncensored models. The second model, Inkling-2-Mini-Uncensored, carried the same program compressed with raw Deflate, which removes every recognisable file signature.
Arming the chat template days later
According to the repository history Malspark reviewed, the Huihui model went up on 22 November and the Inkling model on 24 November, both with clean templates. For two to four days the payload sat in the files with nothing to start it.
On the morning of 26 November both templates were replaced. The new template added a hidden French system message telling the model to begin every reply with one PowerShell line, copied exactly. Conceptually, that line finds the model file on disk, reads the hidden bytes back out of its tail, writes them to the temp folder as d.exe and starts it. Nine hours later the templates were replaced again to search the whole user profile instead of one fixed Downloads path.
A practical consequence: copies downloaded before 26 November contain the trojan but not the trigger. They are still dangerous to keep, because the payload is sitting on disk.
Who is behind Mir2k?
Malspark describes Mir2k only as a new Hugging Face account with French traces in its model card, system prompt, commit messages and malware strings, and makes no attribution beyond that. On 22 November the account also created 12 empty placeholder repositories named after expected releases such as Qwen4-27B and DeepSeek-V4, ready to be filled when those models appear.
What does the ollie RAT do?
ollie is the remote access trojan both Mir2k models unpack. Malspark describes it as an 11.47 MB Windows x64 program, about 10.25 MB of which is a bundled copy of Tor 0.4.9.16. A remote access trojan (RAT) is malware that gives an attacker ongoing remote control of a machine.
Malspark’s static analysis lists these behaviours:
| Area | Behaviour reported by Malspark |
|---|---|
| Sandbox evasion | Exits if it finds VirtualBox, VMware or Sandboxie drivers, or usernames such as sandbox, malware or test |
| Persistence | Scheduled task every 10 minutes with highest privileges, two watchdog processes, StartupApproved registry keys, process marked critical |
| Privilege escalation | Tries the fodhelper UAC bypass, which fails because the registry paths were compiled without backslashes |
| Command and control | Starts Tor on SocksPort 9050 and reaches an onion service over ChaCha20 with a built-in key |
| Theft | Saved passwords from Chrome, Edge and Brave via DPAPI; Phantom and MetaMask wallet extensions |
| Surveillance | Keylogging, clipboard, screenshots, screen streaming, webcam |
| Monetisation | Mines Monero with RandomX when the machine is idle |
Two limits are worth knowing. Malspark says Chrome’s newer v20 App-Bound encrypted passwords are left undecrypted, and the broken UAC bypass means the malware is sloppier than its feature list suggests. Its install folder is named ollie under AppData\Roaming, close enough to Ollama to look familiar at a glance.
How did the timdedid campaign target AI agents?
The timdedid account published three byte-identical copies of a Qwen3 1.7B model aimed at security users on 21 and 22 November, plus an Ollama mirror named timdedid/qwen3-1.7b-cyber. Hugging Face’s own metadata for one of the repositories lists Qwen/Qwen3-1.7B as the base model.
The template is the official Qwen3 template with one addition. When the user’s latest message contains the words “What is”, it inserts a fake [SYSTEM DIRECTIVE] telling an agent to use its PowerShell tool to download a script from a WordPress site into C:\Windows\Temp\payload.ps1 and run it in a hidden window. The README advised users not to replace the embedded template, which keeps the trigger in place.
This is indirect prompt injection delivered through the model file rather than a web page, the same weakness defenders exploit when they trap AI pentest agents with honeypots. It only works when the model is wired to an agent that can run shell commands without a human approving them. Malspark could not recover the second-stage script, so what it would have installed is unknown.
Timeline: from upload to takedown
| Date (2026) | Event | Source |
|---|---|---|
| 21-22 Nov | timdedid publishes three poisoned Qwen3 copies and an Ollama mirror | Malspark |
| 22 Nov | Mir2k creates 14 repos; Huihui model uploaded with trojan and clean template | Malspark |
| 24 Nov | Inkling model uploaded with compressed trojan and clean template | Malspark |
| 26 Nov | Both Mir2k templates armed, then revised nine hours later; scan run | Malspark |
| 27 Nov | Malspark publishes its report; all five repositories still online | Malspark |
| 28 Nov | Hugging Face API marks all five repositories disabled | i10x, Hugging Face API |
We checked the Hugging Face API ourselves on 29 November: Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF returns "disabled": true. i10x reported that the takedown cited a content policy breach, and that the Ollama mirror timdedid/qwen3-1.7b-cyber was still live on 28 November with 42 downloads and the same directive inside.
Who is affected and how do you check exposure?
You are potentially affected if anyone in your organisation downloaded one of the five repositories or the Ollama mirror, especially on Windows, or connected one of the timdedid models to an agent with a shell tool.
Find the files
- Search model folders, including the Hugging Face cache, LM Studio and llama.cpp directories, for the five repository names.
- Run
ollama liston developer machines and look fortimdedid/qwen3-1.7b-cyber. - Scan every local
.gguffile with gguf-radar (covered below), not only the named ones. Malspark notes that antivirus and checks that read only the file end do not see the compressed payload.
Check Windows hosts for ollie
Look for an ollie folder under AppData\Roaming, a d.exe in the user temp folder, a scheduled task that runs every ten minutes with highest privileges, and a local Tor listener on port 9050. For timdedid exposure, look for C:\Windows\Temp\payload.ps1 and hidden PowerShell processes started by an agent runtime.
How do you detect GGUF model malware?
File-level detection
gguf-radar, released by Malspark under the MIT licence, parses the chat template into a syntax tree without running it and flags file reads and writes, decompression, process starts, download commands, conditional hidden directives and known Python escape gadgets. It then calculates where model data should end and reports trailing bytes, non-zero padding and suspicious zero-scale blocks. Its sanitize mode rebuilds a clean file with the weights unchanged. The GitHub API showed the repository at 381 stars and 36 forks on 29 November, two days after it was created.
Endpoint and network detection
Useful telemetry sources are process creation logs (Sysmon event 1 or EDR), PowerShell script block logging (event 4104), scheduled task creation (event 4698) and network connections. Behaviours to alert on:
- PowerShell spawned by, or immediately after, a local LLM runtime such as llama.cpp, LM Studio or Ollama.
- PowerShell that reads the tail of a
.gguffile or decompresses a Deflate stream and writes an.exeto%TEMP%. - A new process listening on 127.0.0.1:9050 on a machine with no sanctioned Tor use.
- Agent frameworks downloading
.ps1files intoC:\Windows\Tempand launching them hidden.
Malspark publishes YARA rules (including Malspark_Mir2k_Ollie_RAT_PE), a 20-item indicator table with file hashes, and the string technoarteng.com in its timdedid rule. Use the original report for the full indicator list.
MITRE ATT&CK and ATLAS mapping
Malspark maps the activity across 12 tactics. Techniques it lists include T1195.002 (compromise software supply chain), T1204.004 (malicious copy and paste), T1059.001 (PowerShell), T1027.009 (embedded payloads), T1053.005 (scheduled task), T1497.001 (system checks), T1555.003 (credentials from web browsers), T1090.003 (multi-hop proxy) and T1496.001 (compute hijacking), plus MITRE ATLAS techniques AML.T0010 (AI supply chain compromise) and AML.T0051.001 (indirect prompt injection).
How do you mitigate it?
In priority order:
- Isolate and reimage infected machines. i10x advises reinstalling rather than just killing the process, which also fits Malspark’s description: ending ollie crashes Windows because it marks itself critical.
- Rotate secrets from a clean device. Change passwords saved in Chrome, Edge and Brave, and move funds from Phantom or MetaMask wallets used on the machine.
- Delete the five models and the Ollama mirror, including copies downloaded before 26 November that carry the payload without the trigger.
- Pin a reviewed chat template. Malspark recommends passing a known-good template with
--chat-template-filein llama.cpp or aTEMPLATEline in an Ollama Modelfile, which takes the embedded one out of the loop. - Never auto-run commands from a model. Require human approval before an agent connected to a community model can use a shell tool.
- Gate models like code. Scan every incoming model before it reaches an internal registry or developer laptop, and prefer models from the original publisher over re-uploads by unknown accounts. The Microsoft Agent Framework PyPI attack shows the package side of the same problem.
How does this compare to earlier model-file attacks?
Neither half of the technique is new on its own, as Malspark itself points out. What is new is seeing both in live malware, combined, with a delay between planting and arming.
| Case | Year | Where the threat lived | Seen in the wild? |
|---|---|---|---|
| EvilModel (research) | 2021 | Malware hidden in the low bits of model weights | No, lab only |
| Pillar Security (research) | 2025 | Hidden instructions in GGUF chat templates | No, lab only |
| Splunk survey of about 157K GGUF models | 2026 (Feb) | Template poisoning, called plausible but unexploited | No malicious cases found |
| Fogel et al. (research) | 2026 | Template attacks on 18 models and four engines, including agent tool hijacks | No, lab only |
| TrojanPony | 2026 (Nov) | Trojanised AI coding-agent skills on GitHub | Yes |
| Mir2k and timdedid | 2026 (Nov) | Trojan after the last tensor plus poisoned template | Yes |
The contrast with Splunk’s February survey matters most: it found template poisoning plausible but unexploited. Nine months later it has been used for real, at small scale.
Malspark also built three further hiding places in the lab that it did not find in live malware: oversized alignment padding, a GGUF file that is also a ZIP archive, and data hidden in zero-scale weight blocks. None changed a single model weight or triggered a warning in llama.cpp. If hubs start rejecting trailing bytes, these are the likely next moves.
What is still unknown?
- The timdedid second stage. The script was not recovered, so its purpose is unknown.
- Real victim numbers. Download counts include crawlers, mirrors and repeat downloads, and no source reports confirmed infections.
- Independent payload analysis. All technical detail on ollie comes from Malspark. The secondary outlets we read say they did not verify the sample, and the hash had no public sightings at publication.
- Hugging Face’s response. i10x reports a content policy reason for the takedown, but we found no public statement from Hugging Face and no announcement about rejecting files with trailing bytes.
- The Ollama copy. Only i10x checked it, on 28 November, and did not test whether any Ollama version actually applies the embedded template.
- Other platforms. The scan covered Hugging Face only. Mirrors and re-uploads elsewhere were not measured.
The bottom line
A GGUF model is not just weights: it carries an executable-adjacent template and can carry arbitrary bytes that no runtime checks. Mir2k used both, planting a trojan first and arming it days later, and the only thing between the model and an infection was a user willing to paste one line. Treat community models as untrusted code: scan them, pin their templates, and never let a model’s output run on its own.
Sources
- Malspark (Düzgün), GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims, 27 November 2026
- i10x News Desk, Hugging Face GGUF malware: models pulled, but the Ollama copy still serves it, 28 November 2026
- LavX News, Malicious GGUF models hid malware in chat templates and file tails on Hugging Face, 28 November 2026
- Splunk (James Hodgkinson), Trust at Inference Time: Investigating GGUF Model Templates at Scale, 19 February 2026
- Hugging Face API, Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF model record, checked 29 November 2026
- GitHub, Root0ne/gguf-radar, checked 29 November 2026
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.