IntermediateAI
Five Poisoned GGUF Models on Hugging Face Hid a Windows Trojan
- ai safety
- hugging face
- local inference
- malware
- supply chain
A scan of every public model repository on Hugging Face found five GGUF files that hid malware or poisoned chat templates, with 2,428 downloads between them before the platform disabled the repositories. Malspark, the security project behind the open-source gguf-radar scanner, published the findings on November 27, 2026, after scanning 3,273,389 repositories the previous day. Hugging Face counts downloads rather than people, so the number of affected users is at most that figure, and the report does not confirm a single infection.

What the Scan Found
The scan covered 226,310 GGUF repositories holding 2.56 PB of weights and parsed 572,184 chat templates statically, without executing any of them. Headers and file ends were read through HTTP Range requests, so no model was downloaded in full. Manual review then removed security test repositories, harmless persona prompts and published research samples, leaving five that were still online on November 27.
| Repository | Campaign | Method | Downloads |
|---|---|---|---|
| Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF | Mir2k | Reply prefix with hidden executable | 1,488 |
| Mir2k/Inkling-2-Mini-Uncensored-GGUF | Mir2k | Reply prefix with hidden compressed executable | 458 |
| timdedid/qwen3.8-cyber-uncensored | timdedid | Tool hijacking | 271 |
| timdedid/qwen3-cyber-UNCENSORED-2 | timdedid | Tool hijacking | 136 |
| timdedid/qwen3-cyber-UNCENSORED | timdedid | Tool hijacking | 75 |
The five repositories had 1,502 downloads when the scan ran on November 26. Malspark counted 2,428 the next day, and by November 29 the counters on the disabled pages showed 2,807. Almost all of the growth came from the two Mir2k models.
How the Attack Works
A GGUF file begins with a header and a metadata table, then a tensor table, then padding, then the weights. Loaders such as llama.cpp and LM Studio read exactly the byte ranges the header points to and ignore everything else, including anything appended after the last tensor. The chat template lives in the metadata under tokenizer.chat_template, and the runtime passes every conversation through it before the model sees it.
Both halves matter. A template is a small Jinja2 program, and C++ runtimes execute it in a restricted engine with no Python behind it, so classic template injection that reaches the operating system does not apply. Ordinary template logic can still insert text the user never sees. In the Mir2k models the template added a French system message instructing the model to open every reply with one PowerShell line, copied character by character. In the later version of that line, the command finds the largest .gguf file in the user profile, reads its last bytes and writes them to %TEMP%\d.exe.
The two halves were uploaded separately. Mir2k created 14 repositories on November 22, twelve of them empty placeholders named after models that had not shipped yet, including Qwen4-27B and DeepSeek-V4. The first real upload carried the executable after its last tensor under a clean template; a second model on November 24 carried the same program compressed with raw Deflate, which strips recognizable file signatures. On the morning of November 26 both templates were replaced within about an hour, and replaced again nine hours later. Files downloaded before that morning contain the payload but nothing to start it.

The second account, timdedid, targeted agents instead of people. Its three repositories held byte-identical copies of a small Qwen3 model, and the template watched for the words “What is” in the latest message. When they appeared it inserted a fake [SYSTEM DIRECTIVE] ordering an agent with shell access to fetch a script from a WordPress site and run it with PowerShell. Nobody had to paste anything. Malspark could not recover the second stage, so what it would have installed is unknown.
Detection, and What Disabling Does Not Fix
Malspark released gguf-radar alongside the report. The tool parses a model file statically, checks the chat template for the patterns these campaigns used, and flags bytes after the last tensor; for Hugging Face models it downloads only the small ranges it needs. It can also rebuild a clean GGUF with the weights unchanged, which is the practical option for a file whose payload sits outside the tensors.

The files passed the checks that exist. Malspark reports that antivirus engines and pickle scanners raised no alert on either Mir2k file, which follows from where the payload sits: appended after the weights, and in one case compressed, so a scanner that reads the last few kilobytes sees filler. Pickle scanning looks for unsafe deserialization in .bin and .pt files, not for executable bytes in a GGUF. The template half is not unique to GGUF either; Safetensors and PyTorch models carry the same kind of template in tokenizer_config.json or chat_template.jinja.
Disabling a repository does not reach copies that already exist. Reporting on November 29 found an Ollama mirror of the timdedid model still listed, and every file downloaded before the takedown is still on disk. The technique is not new either: Pillar Security demonstrated poisoned GGUF templates in July 2025, and a 2026 paper measured the attack across 18 models and four inference engines, including trigger phrases that stay dormant and hijacking of an agent’s tool calls. Pillar said at the time that responses from vendors including Hugging Face and LM Studio indicated they did not treat it as a flaw in their platforms.
What This Means
The usual reassurance about local models is that weights are data, and data does not run. That holds for the tensors and not for the rest of the container. A GGUF file is data plus a template that the runtime applies on every turn, and the template can steer both a person and an agent. The dangerous configuration is not a laptop running inference. It is an agent with shell access reading a model’s output as instructions, which is exactly the setup the timdedid files targeted.
For readers who download open weights, the practical rule is to treat a model file as untrusted software rather than as a document. That means checking provenance and repository history, scanning before first use, and being more careful with uncensored or abliterated builds from new accounts, which is where both campaigns operated. The download count is not a safety signal: 2,428 downloads accumulated across files that were live for less than a week.
It also puts a number on a risk that has been discussed mostly in the abstract. Five malicious files in 3.27 million repositories is a small fraction, and there is still no confirmed infection. The interesting part is not the rate. It is that the attack needed no vulnerability in the loader, no malicious pickle and no compromised account, only the parts of the format that were designed to be flexible.
This post was drafted with AI assistance and reviewed by RITS staff.
Sources
- Malspark — GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims (November 27, 2026)
- GitHub — Root0ne/gguf-radar
- Startup Fortune — Poisoned Hugging Face GGUF models asked users to run hidden malware (November 29, 2026)
- Pillar Security — LLM Backdoors at the Inference Level: The Threat of Poisoned Templates (July 2025)
- Fogel et al. — poisoned chat templates across 18 models and four inference engines (2026)
- EvilModel — hiding malware in model weights (2021)



