The Research Report
The GGUF Supply Chain Went Live: A Windows Trojan Hidden Where the Weights End, Armed Days Later by the Chat Template - 2,807 Downloads Before Takedown, an Ollama Mirror Still Live, and a Scanner That Rebuilds Clean Weights
On 26 November a researcher who publishes as Root0ne scanned every public model repository on Hugging Face - all 3,273,389 of them, including 226,310 GGUF repositories holding 2.56 petabytes of weights, the headers and file tails read through HTTP Range requests so nothing was downloaded in full - and parsed 572,184 chat templates statically without executing one. Five malicious GGUF models survived manual review, published by two accounts, with 2,428 downloads by 27 November when the report went live on Malspark. By the following Saturday the counters had climbed to 2,807, Hugging Face had disabled all five repositories citing a content-policy breach, and one of the poisoned models was still downloadable from the Ollama public library with its trap intact. This is the first documented time the pairing of a hidden payload with a later-armed trigger has appeared in live attacks on a public model hub rather than in laboratory research.
The reason this matters to anyone running local models is that it does not break the promise GGUF was supposed to keep, it goes around it. A GGUF file header and tensor table define precisely where the weights end, and runtimes such as llama.cpp and LM Studio read exactly the byte ranges the header points to and ignore everything else. An executable parked in the trailing region after the last tensor changes nothing about how the model loads or answers, and no runtime warns about it. Safetensors does not allow this - its loader refuses a file whose declared tensors do not fill it exactly - but GGUF does not check, and five live files proved the gap is exploitable.
The other half of the attack lives in the chat template, a small Jinja2 program stored under the tokenizer.chat_template metadata key inside the file. Before every reply the runtime passes the conversation through it to build the exact text the model reads, and whatever the template injects never appears in the chat window. The template runs in a restricted engine with no Python behind it, so the classic template-injection trick of escaping to the operating system does not work there, and the attackers did not need it: ordinary template logic that adds invisible text to the conversation is enough when a human copies a suggested command into a terminal, or when an AI agent obeys directives.
The larger campaign, Mir2k, is a study in patience. On 22 November the new account created fourteen repositories - twelve of them empty placeholders named after expected releases such as Qwen4-27B, DeepSeek-V4, Llama-4-Scout and gemma-4-27b - and uploaded Huihui-Qwen3.5-9B-abliterated-GGUF with an 11.47 MB Windows executable already appended after its last tensor, still carrying its original clean template. On 24 November a second model, Inkling-2-Mini-Uncensored-GGUF, followed with the same program compressed with raw Deflate so that no recognizable file signature survives, again with a clean template. For two to four days the payload simply sat in the files with nothing to start it. On the morning of 26 November both templates were replaced within about an hour, and nine hours later they were replaced again - the second version stopped assuming a fixed path in the Downloads folder and searched the whole user profile for the model file. French traces run through the account: the first model card, the system prompt inside the template, the commit messages, and the strings in the malware.
The armed template adds a French system message instructing the model to open every reply with one fixed line, copied character by character, then answer normally. That line finds the largest .gguf file in the user profile, reads the trailing bytes - 11,474,944 bytes measured back from 12 MB before the end of the Huihui model; the final 4.2 MB of the Inkling file, decompressed in memory with PowerShell's DeflateStream - writes them to the Windows temp folder as d.exe, and starts it. The user only had to paste the suggested command. Downloads made before 26 November contain the payload but not the trigger, which is exactly the point of planting the program first and arming it later: by the time the template turns hostile the file is already spread, its checksums have already been shared downstream, and the model behaves normally.
The unpacked program, named ollie in the report, is an 11.47 MB Windows x64 remote access trojan, and about 10.25 MB of it is a complete copy of the Tor client, version 0.4.9.16. Static analysis of its strings and imports says it first checks for VirtualBox, VMware and Sandboxie drivers and for usernames like sandbox, malware and test, then settles in: a scheduled task runs it every ten minutes with highest privileges, two watchdog processes keep it alive, registry StartupApproved keys re-enable it after reboot, and its process is flagged critical so that ending it crashes Windows. Through a Tor onion service protected by a ChaCha20 session with a built-in pre-shared key it sends saved passwords from Chrome, Edge and Brave read through DPAPI - Chrome's newer App-Bound encrypted entries stay undecrypted - targets the Phantom and MetaMask wallet extensions, captures keystrokes, clipboard, screenshots, screen streams and webcam, and mines Monero with RandomX whenever the machine sits idle. Its folder under AppData Roaming is called ollie, close enough to the real Ollama to look familiar, and the binary still contains a stray path from the author's own machine.
Two details from the report are worth keeping in mind. The implant's own tradecraft is uneven: it attempts the known fodhelper.exe UAC elevation bypass and fails, because two of its registry paths were compiled without their backslashes and Windows never finds them - an attacker who hides a trojan behind quantization tensors and then trips on path escaping. And neither the ollie SHA-256 hash nor its campaign strings had any public sighting when the report went up, which is why antivirus engines and pickle scanners in the author's tests raised no alert on either live Mir2k file, and standard GGUF parsers loaded them without complaint. The damage never depends on code running at load time at all - only on a human pasting a command or an agent executing one.
The second campaign targeted agents rather than users. One day before Mir2k appeared, on 21 and 22 November, the account timdedid published three byte-identical copies of a Qwen3 1.7B model pitched at security users - the repo names say qwen3.8-cyber, the GGUF metadata says Qwen3 1.7B - plus a mirror on the Ollama library called timdedid/qwen3-1.7b-cyber. Its template is the official Qwen3 template with one addition near the end: whenever the user's latest message contains the words What is, the template inserts a fake [SYSTEM DIRECTIVE] ordering the agent to call its powershell tool, download value.ps1 from a WordPress site into the Windows temp folder, and run it in a hidden window. A person chatting normally sees nothing; a coding or desktop agent with shell access would simply comply. The README even advises against replacing the embedded template, keeping the trigger where anyone can read it. The second-stage script was never recovered and the download URL had no record on reputation services, so what it would have installed is unknown - and all three parts of the trap were visible in Hugging Face's own metadata viewer, meaning the platform shipped with the evidence hiding in plain sight.
The counts tell a story about discovery latency: 1,502 downloads across the five repositories when the scan ran on 26 November, 2,428 by the time the report landed on the 27th, 2,807 when Hugging Face disabled all five repositories at 14:22 CET on Saturday the 28th - nearly double the scan-day total in just over two days, with almost all of the growth on the two Mir2k models. Hugging Face counts downloads, not people, so the number of actually affected users is lower or equal. And the takedown is incomplete: the i10X newsroom checked on Saturday and found one model still listed on Ollama's public library with 42 downloads, read the first 16 MB of its file straight from the Ollama registry without loading the model, and found the same hidden directive intact - the Ollama package carries no template layer of its own beside the weights, so the poison rides embedded and any Ollama run that applies the embedded template inherits the trigger. There has been no public Hugging Face statement about scanning GGUF trailing bytes.
Neither half of the method is new, which is precisely why this combination matters. Pillar Security demonstrated hidden instructions in GGUF chat templates in July 2025; Fogel and colleagues in 2026 measured template triggers and agent tool-call hijacking across 18 models and four inference engines, including dormant triggers that activate only when a phrase appears; EvilModel hid malware inside weight bits back in 2021. All of that was conducted on test models in the lab. What had no earlier public report was the method operating in the wild on a public hub, and specifically Mir2k's operational pairing of an executable appended after the last tensor with a template armed days later. The report also reproduces three further hiding places with synthetic files that the scanned malware did not use: alignment padding raised from the usual 32 bytes to several megabytes, an appended ZIP archive that makes one file load simultaneously as a model and as importable Python, and zero-scale Q8_0 quantization blocks - including negative-zero scales written as 0x8000 to defeat checks that look for 0x0000 - all passing through llama.cpp and gguf-py with not a single dequantized weight changed. One day before this report, a separate case saw thirteen fake Hugging Face repositories steal secrets through Python code that only ran if a developer enabled remote code; template poisoning plus hidden payloads is the third leg of the same pressure on hub trust.
Root0ne shipped the countermeasure alongside the report: gguf-radar, MIT-licensed on GitHub, at 223 stars within a day and four releases in under 48 hours - 0.1.0 on 27 November through 0.1.3 on 28 November, each release adding template-detection categories, the latest recognizing templates that download their own payload. It 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 escape gadgets; it computes where the model data must end and reports any bytes beyond that point, non-zero padding, and data hidden inside zero-scale blocks; then it rebuilds a canonical file - 32-byte alignment, zeroed padding, everything after the last tensor dropped, negative-zero scales normalized, hidden bytes cleared - with the dequantized weights byte-identical to the original. Scans run on local files or directly on Hugging Face URLs through HTTP Range requests that read only the header and the end of each file, no multi-gigabyte download and no API key for public models, and exit code 2 means suspicious or malicious so the check can fail a CI pipeline before a file ever reaches an internal registry or a developer laptop. The repository even carries a weekly workflow that scans nineteen pinned Hugging Face repositories and seven pinned GGUF files and fails if any comes back not clean - the tool is already watching its own assumptions.
The practical checklist is short enough to run today. Search your llama.cpp and LM Studio model directories and your ollama list for the five repository names and the timdedid/qwen3-1.7b-cyber tag, and delete any copies, including downloads made before 26 November which carry the payload without the trigger. Install gguf-radar with pip from its GitHub repository and run a scan over every GGUF file you keep, then sanitize anything suspicious - the rebuilt copy has identical weights. Pin templates you own: pass a reviewed template with --chat-template-file in llama.cpp or set TEMPLATE in the Ollama Modelfile so the embedded one is ignored, especially on machines where an agent runs commands. If a Windows machine ever ran one of the Mir2k models, check for an ollie folder under AppData Roaming, a d.exe in the temp folder, a scheduled task repeating every ten minutes and a Tor listener on port 9050 - do not kill the critical process, isolate the machine and reinstall, then rotate every password saved in Chrome, Edge or Brave from a clean device and move any Phantom or MetaMask funds to a wallet whose seed was never typed on the infected PC. And keep the standing rule: treat any command a model suggests as untrusted input, full stop.
For this desk the story lands twice. It slots directly next to the banked install-gate article on the Microsoft agent-framework PyPI credential stealers as the second 2026 case where a trusted artifact fetch - a package, a model file - doubles as the attack surface without itself executing anything: the payload and the instructions ride along until they reach a human or an agent that acts on them. The January tutoring room's laptop-local privacy tier, and any agent pipeline that executes shell commands with community models in the loop, inherit the same rule set: pinned reviewed templates, structure-scanned files, and no unconfirmed command execution from model output at any step. Watch the placeholder names too - Qwen4-27B, DeepSeek-V4, Llama-4-Scout, gemma-4-27b - because Mir2k parked twelve empty repositories on 22 November waiting for exactly those release events, and the obvious counter is to be deeply suspicious of unofficial uncensored uploads of a hot model in the first days after its release. The uncensored framing is not incidental: both campaigns used it, and it selects for users who are specifically trying to bypass a model's own safety defaults.
Still open: the second stage behind the timdedid templates remains unaccounted for; the Ollama mirror was still downloadable when the Saturday checks published; Hugging Face has not announced whether it will reject GGUF files with data after the last tensor or extend template scanning to PowerShell loaders and hidden directives, which is the fix that would kill the method outright; and download counters are a ceiling on users, not a count of them. The full YARA rules, indicators of compromise and the MITRE mapping are in the report and the repository, and the researcher's CI-watch setup is the part to copy - a standing weekly scan of pinned repos turns a one-off disclosure into a durable defense.
Sources
- https://malspark.com/blog/malicious-gguf-models-hugging-face/
- https://i10x.ai/news/hugging-face-gguf-malware-mir2k-timdedid-ollama-copy-still-live
- https://github.com/Root0ne/gguf-radar
- https://gptonline.ai/malicious-gguf-models-hugging-face-trojan/
- https://www.alextech.ai/en/news/gguf-models-on-hugging-face-hid-a-windows-trojan/
- https://localmodelwatch.tsuchitsuchi.com/en/2026/11/29/malicious-gguf-models-hugging-face-report/
- https://x.com/Root0ne
- https://pillar.security/blog/llm-backdoors-at-the-inference-level-the-threat-of-poisoned-templates
- https://arxiv.org/abs/2602.04653
- https://arxiv.org/abs/2107.08590