Hugging Face has disabled five booby-trapped AI models found by an outside researcher. Its own records show that the three never altered after upload are still marked safe by every scanner that checked them. They carried instructions for the model, not code that runs on load, and the scanners are built to catch code. One copy is still on Ollama.
Updated November 30, 2026, 4:25 a.m. New York time (EST).
Last week a security researcher found malware hidden inside AI model files on Hugging Face, the most widely used site for sharing open AI models. In a detailed write-up published on November 27, the malware analysis project Malspark said it had scanned all 3,273,389 public model repositories on the Hub on November 26. It found five malicious models from two accounts, downloaded 2,428 times between them. All five were in GGUF, the format in which models for local use are usually shared and which tools such as llama.cpp, LM Studio and Ollama run on ordinary computers. Hugging Face has since disabled them.
Most coverage has focused on the inventive way the files were built. The more useful lesson for anyone who downloads open models is in Hugging Face's own records. We checked the Hub's public data for all five repositories early on November 30, New York time (EST). The files that were never changed after upload still show a clean result from every scanner that checked them. Nothing broke. The attack simply sits outside what those scanners were designed to look for.
What the poisoned models did
GGUF chat models normally carry a chat template. This is a small program, written in the Jinja templating language, that turns a conversation into the exact text the model reads before each reply. Users normally never see it. Both campaigns Malspark found abused that template.
The first account, Mir2k, uploaded two "uncensored" models on November 22 and 24. According to Malspark, each file had a Windows remote access trojan added after the model's last tensor, in a part of the file that inference software never reads. The models loaded and behaved normally. Then, on the morning of November 26, the account rewrote both chat templates so that the model would start every answer with a single PowerShell line. Anyone who copied and ran that line would extract the hidden program from the model file on their own disk and start it. Malspark's analysis says the implant, which it calls "ollie", steals saved passwords from Chrome, Edge and Brave, goes after the Phantom and MetaMask crypto wallets, logs keystrokes, can capture the webcam, and mines Monero when the computer is idle. Mir2k had also set up 12 empty repositories named after models that have not been released yet, such as "Qwen4-27B" and "DeepSeek-V4", which Malspark describes as ready to be filled when those models appear.
The second account, timdedid, did something simpler, and for people building AI agents it is more worrying. It published three identical copies of a small Qwen3 model aimed at security users. Their template was the official Qwen3 template with one addition: whenever the user's message contained the words "What is", the template quietly added a fake "[SYSTEM DIRECTIVE]" telling an agent to use its PowerShell tool to download a script and run it in a hidden window. Malspark could not recover that second-stage script, so what it would have installed is unknown.
What Hugging Face's scanners said
Hugging Face lists several security checks on every model file. Its documentation describes a malware scanner, pickle import scanning, and third-party scanners from Protect AI and JFrog. The Hub's API publishes the result of each check for each file.
For the three timdedid files, which have not changed since they were uploaded on November 21 and 22, the records we pulled on November 30 show:
- Antivirus scan: "No security issues detected."
- VirusTotal: "0/71 engines detect it as malicious."
- JFrog: "Safe GGUF model."
- Protect AI: status "safe", with the note that the file is "vulnerable to threat(s) PAIT-GGUF-100."
- Overall file status: "safe."
That Protect AI note looks like a warning, but it is not one. Palo Alto Networks, which now hosts Protect AI's threat database, defines PAIT-GGUF-100 as "GGUF Model Contains a Jinja Template". It calls it "a low-severity, informational finding" and says that "most GGUF chat models legitimately include a chat template." The scan looks for known ways to break out of the Jinja sandbox, such as references to __subclasses__ or __globals__, and flags those separately as PAIT-GGUF-101. The timdedid template did none of that. In other words, the scanner reported that a template was present and that it found nothing malicious in it.
The two Mir2k files show a different gap. Hugging Face's documentation says it runs "every file of your repositories that is smaller than 2 GB" through its malware scanner. The Mir2k files on the Hub today are 6.67 GB and 17.48 GB. Their records show the antivirus check as "unscanned" and VirusTotal as "File not scanned in VirusTotal". One caution applies here. The repository history shows both Mir2k files were replaced again on November 28, at 3:01 and 3:23 a.m. New York time (EST), with commit messages in French that translate as "clean file without tail" and "clean file, short instruction". The scan results on the Hub now describe those later versions, not the trojan-carrying ones Malspark analysed. What the size rule does establish is that model files larger than 2 GB, a size many popular LLM downloads exceed, fall outside the antivirus pass the documentation describes.
Why the scanners missed it
The Hub's security tooling grew up around one main threat: model files that run code when they are loaded. Pickle, a Python format, is the default for PyTorch model weights, and Hugging Face's own documentation warns that loading a pickle can trigger "arbitrary code execution". Scanners look for dangerous imports, known malware signatures and template code that can reach the operating system. Those are real dangers, and the scanners are built to find them.
The timdedid template contained none of those things. It was ordinary template logic plus a few sentences of English. It does nothing on its own. It only becomes dangerous when a model reads those sentences, treats them as a system instruction, and has a tool that can run commands. Malspark makes the same point: C++ runtimes render templates in a restricted engine, and "the attacks found in this study do not need to escape that engine." This is prompt injection delivered through the supply chain, and a scanner that looks for code has nothing to match against.
The Mir2k trick has the same shape. The trojan sat in bytes no loader reads, and in one file it was compressed in a way that, Malspark says, removes every recognisable file signature. Nothing ran until a person pasted in a command the model had been told to print. Malspark's own scanner found the campaigns by statically parsing 572,184 chat templates and checking where each file's model data should end. That is a structural check, not a signature check.
Neither technique is entirely new. Pillar Security described poisoned chat templates in July 2025, and Malspark cites academic work that measured the attack across several inference engines. What Malspark says is new is seeing them used in real attacks on the Hub, and combined the way Mir2k combined them.
The copy that is still online
Disabling a repository on Hugging Face does not remove copies elsewhere. Malspark noted that timdedid also published an Ollama mirror. On November 30 that model page, timdedid/qwen3-1.7b-cyber, was still live and showed 325 downloads. We read only the metadata header of the model file from Ollama's registry, without downloading the 1.36 GB file or running anything. Its embedded chat template still contains the "What is" trigger and the hidden PowerShell download command. The file is exactly the same size in bytes as the disabled Hugging Face copies.
Inside Ollama itself, that template is probably inert. Ollama uses its own template format, and its import code only converts an embedded Jinja template when it recognises it as one it already knows. Otherwise it falls back to passing the prompt through unchanged, as its template documentation describes. The registry entry for this model has no template layer, which fits that fallback. But the file can still be pulled and used in other software that does apply the embedded template, and the mirror shows that a takedown on one hub does not reach the others.
What this means for people running open models
The scale was small. A download count is not a count of victims: Hugging Face counts downloads, not people. Mir2k's payload only ran if a user pasted a command, and the timdedid trigger only mattered for agents that had shell access. The counters on the disabled repositories have also kept rising, from 2,428 on November 27 to 4,221 in total when we checked on November 30. Some of those later downloads are probably researchers pulling the files after the report, so the increase should not be read as new victims.
The weakness these files exposed is bigger than the numbers. A green "safe" badge on a model hub means a file is unlikely to run code by itself when it loads. It says nothing about what the model has been told to do. As more people give local models tools that can run commands, the chat template becomes part of the attack surface, just like the weights.
The defences are cheap but manual. Protect AI's own guidance for PAIT-GGUF-100 is to compare a model's template with the one the original model creator published, or to replace it with a known-good template. Malspark recommends supplying a reviewed template directly, with --chat-template-file in llama.cpp or a TEMPLATE line in an Ollama Modelfile, so the embedded one is never used. It also recommends treating any command a model suggests as untrusted. For hubs, Malspark suggests rejecting GGUF files that contain bytes after the last tensor or non-zero padding, and extending template scanning to cover hidden directives and PowerShell loaders. Malspark has released its scanner, gguf-radar, as free MIT-licensed code. It is also the party that found the problem and built the tool, so its claims about detection deserve independent testing.
The open question is whether hubs will start checking what a template says, not only what it can execute. Until they do, the person deciding whether a community model is safe to give tool access to is the person downloading it.
Sources
- Malspark: GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims (Nov 27, 2026)
- Hugging Face Hub API: timdedid/qwen3-cyber-UNCENSORED repository record (checked Nov 30, 2026)
- Hugging Face Hub API: Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF repository record (checked Nov 30, 2026)
- Hugging Face Docs: Malware Scanning
- Hugging Face Docs: Pickle Scanning
- Hugging Face Docs: Third-party scanner: Protect AI
- Hugging Face Docs: Third-party scanner: JFrog
- Palo Alto Networks Insights DB: PAIT-GGUF-100, GGUF Model Contains a Jinja Template
- Palo Alto Networks Insights DB: PAIT-GGUF-101
- Ollama: timdedid/qwen3-1.7b-cyber model page (checked Nov 30, 2026)
- Ollama Docs: Template
- Ollama source: server/model.go (template detection)
- Pillar Security: LLM Backdoors at the Inference Level: The Threat of Poisoned Templates (Jul 9, 2025)
- GitHub: Root0ne/gguf-radar
