Five poisoned GGUF models on Hugging Face reached 2,428 downloads: a Tor-backed Windows implant hidden after the last tensor, and a chat template that tells coding agents to run PowerShell. What to scan before you load a local model
A scan of all 3.27 million public Hugging Face model repositories found two campaigns that weaponise the one part of a model file nobody reads: the chat template.

Model files have carried malware before, usually through Python pickle serialisation. The two campaigns documented by the threat-intelligence project Malspark on November 27 use GGUF, the format llama.cpp, Ollama and LM Studio load, which was designed so that loading a model never executes code. The attackers did not break that design; they went around it, hiding a payload where loaders do not look and rewriting the one text inside a GGUF that is interpreted at run time: the chat template.
What the scan found
Malspark read the headers and file tails of 3,273,389 public Hugging Face model repositories on November 26, covering 226,310 GGUF repositories and 572,184 chat templates, using range requests rather than full downloads. After removing test repositories, persona prompts and research samples, five malicious models from two accounts remained. Their download counters rose from 1,502 to 2,428 in a day, with all five still online at publication. Hugging Face has not commented in either source, and downloads are a platform counter, not infected machines.
Campaign one: the implant after the last tensor
The account Mir2k, created on November 22, uploaded two "uncensored" quantisations, one of a Qwen3.5-9B abliteration and one of Inkling 2 Mini, plus twelve empty placeholder repos named after releases people are waiting for. GGUF loaders ignore any bytes after the final tensor, so the author appended an 11.47 MB Windows x64 executable there, in one case compressed with raw Deflate to strip file signatures. For four days the templates were clean. On the morning of November 26 both were changed to a French-language system message instructing the model to begin every reply with a single PowerShell line, and nine hours later changed again so the line searches the whole user profile for the largest .gguf file rather than a fixed Downloads path. The line carves the trailing bytes out of the model file and writes them to %TEMP%\d.exe.
The implant, which Malspark calls "ollie", checks for sandboxes, persists through a ten-minute scheduled task and two watchdog processes, talks to an onion service over embedded Tor, steals browser passwords, targets the Phantom and MetaMask wallet extensions, logs keys, captures the screen and webcam, and mines Monero when idle. Anyone who downloaded the Mir2k files before November 26 has the payload on disk but not the trigger.
Campaign two: a directive aimed at agents, not people
The account timdedid uploaded three byte-identical copies of a Qwen3 1.7B model labelled "cyber-uncensored". The weights are untouched. The only change is to the official Qwen3 template: when the latest user message contains the phrase "What is", it injects a "[SYSTEM DIRECTIVE]" telling any agent with a PowerShell tool to download a script from a WordPress site to C:\Windows\Temp and run it hidden. The README advises users not to replace the embedded template. The second-stage script was never recovered. It is the first documented model file engineered so the attack succeeds only when the model is driving tools, which is how most local models are now used. Malspark also found an Ollama mirror.
What to do
- Scan every GGUF before it reaches a laptop or an inference box. Malspark's open-source gguf-radar parses templates without executing them, flags out-of-bounds bytes and can rebuild a clean file with weights unchanged; the post ships four YARA rules.
- Treat the chat template as code. Diff it against the base model's and pin a reviewed copy with llama.cpp's --chat-template-file or an Ollama Modelfile TEMPLATE, so the file's own template is never used.
- For tool-enabled agents, require approval for shell actions and log every tool call alongside the model text that preceded it. A directive that appears in model output is not an instruction.
- Check Windows hosts that pulled either account's files after November 26 for "ollie" folders under AppData, a scheduled task impersonating Edge, and Tor traffic.
- Ask your model hub, internal or public, to reject GGUF uploads with trailing bytes. Two of the five files would have failed that one rule.
What to watch
Whether Hugging Face and Ollama confirm removals and add tail-byte and template checks to upload scanning, and whether the Mir2k placeholder repositories, named for unreleased models like Qwen4 and DeepSeek-V4, are ever filled.
Sources
Malspark: GGUF LLM models with hidden malware on Hugging Face reached 2,400+ victims ↗Brandefense: Malicious GGUF models, hidden payloads ↗The story so far
- Nov 30, 2026 RSNA 2026 opens with the first FDA-cleared five-year breast-cancer risk model from 3D mammography, a cleared chest X-ray…
- Nov 30, 2026 Rocket, the Accel- and Salesforce-backed vibe-coding platform, shuts down on December 31: building stops December 5, hos…
- Nov 30, 2026 21 cryptographers form an incident review group as rumours spread that an AI lab cracked RSA-2048: no evidence, no named…
- Nov 29, 2026 College Board's ARTEX breach: account creation and the CSS Profile offline before December 1 aid deadlines, and the one …
Key terms in this story
- Chat template The text template, usually Jinja, stored with a model that formats system, user and assistant turns into the token sequence the model was trained on.
- Inference Running a trained model to produce output. What you pay for when you call an API.
- .pth file (Python) A small text file in a Python site-packages directory that the interpreter reads at start-up to extend the import path, and that can also execute code.
- Agent An AI system that pursues a goal by taking actions with tools, in a loop, rather than answering a single question.
- GGUF The binary file format used by llama.cpp, Ollama and LM Studio to store quantised model weights, metadata and the chat template in one file designed to be loaded without executing code.
More in Security
All →
College Board's ARTEX breach: account creation and the CSS Profile offline before December 1 aid deadlines, and the one check every owner of a sign-up flow should run this week
The first household-name victim of the open-source AI attack framework got in through a professional-account signup page, which is exactly the kind of…

SAP's GitHub breach: stolen employee tokens, altered source code, replaced signing keys, and the five checks every SAP customer should run this week
SAP says no customer business data was accessed; the reported mechanism, authentication tokens replayed against GitHub, is the one most enterprises ar…

Switzerland says AI agents breached four of five targets, and Microsoft says Salt Typhoon now runs ARTEX: the two reports read as one
A national cyber office has told operators to patch internet-facing systems within 24 hours because agent attacks succeed against weak passwords and k…
Get the brief in your inbox
One email every morning: the stories that mattered in AI, each with a one-line "why it matters" for your role. Free, no ads, unsubscribe any time.
Published daily by AI Briefing. We never share your address.