Skip to content
HomeBriefFor youTrackersTopicsCompaniesGlossaryNewsletterSecurityHealth & medicineFinance & marketsRoboticsModels & researchPolicy & regulationEnterprise & businessDeveloper tools
Security · Nov 30, 2026 · 3 min read

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.

Why it matters
SecurityAdd two checks to your model-intake gate today: reject any GGUF with bytes after the last declared tensor, and diff the embedded chat template against the upstream model's. Neither is covered by antivirus.
DevelopersIf you run a local model with a shell tool, the template is executable policy. Pin a reviewed template with --chat-template-file or an Ollama TEMPLATE and never let an agent act on a 'system directive' that arrives inside the model's own output.
ML engineersThe 'uncensored' and 'abliterated' finetunes that people download for red-teaming are the lure. Mirror the ones your team uses into an internal registry after scanning, and stop pulling from unknown accounts.

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.

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.
All 143 terms →
securitymodelsagentsdatatools
Written in our own words from the linked sources · updated 2026-11-30 · corrections: corrections@aibriefing.io

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.
Like this? Get tomorrow's brief by email, free.