Five Hugging Face GGUF repositories combined chat-template poisoning with bytes hidden after model tensors, and Hugging Face counted 2,428 downloads before disclosure. Security researcher Root0ne published the findings on November 27, 2026 via Malspark and the open gguf-radar tool. The story is not a generic Hub breach: it is a supply-chain pattern aimed at developers who pull local LLM weights into llama.cpp, Ollama, or agent harnesses without auditing metadata.
If you run open models on a workstation that also hosts Claude Code, Cursor, or other agents, this attack class belongs in the same review lane as fake desktop clients and backdoored fine-tunes — except the lure here looks like a normal model card.
Agents that act on your behalf need rules. See how explainx helps secure your agents →
TL;DR: what happened and what to do
| Question | Answer |
|---|---|
| What was found? | Five malicious GGUF repos in a scan of 3,273,389 public Hub models (Malspark) |
| How many downloads? | 2,428 cumulative Hub download events (not necessarily unique people) |
| Two attack halves? | Chat template poisoning plus bytes after the last tensor (GGUF-specific) |
| Named campaigns? | Mir2k (2 repos, Windows RAT ollie) and timdedid (3 repos, agent-oriented templates) |
| First step? | Run gguf-radar (or equivalent) before loading weights; never curl | bash a line a model prints |
| Agents? | Treat model-suggested shell commands like untrusted user input; use tool gates (MCP basics) |
How GGUF hides malware two different ways
GGUF is the container format many local inference stacks use. Two features attackers abused are specific enough that defenders can scan for them statically.
Chat templates run before every reply
The field tokenizer.chat_template is a Jinja2 program embedded in the file. Runtimes render it to build the prompt the model actually reads. Malspark explains that classic server-side template injection against the OS does not apply in restricted C++ engines, but attackers do not need escape tricks: they can append instructions that never show in the chat UI yet steer the model toward dangerous output.
In timdedid models, a user message containing a trigger such as What is caused the template to inject a fake [SYSTEM DIRECTIVE] block. That block told an agent with shell access to download and execute a remote script (Malspark §2.1). That is directly relevant if your harness lets the model propose terminal commands.
In Mir2k models, the template forced the assistant to open every answer with one PowerShell line. A human copying “the model’s fix” from chat could run it; so could a careless agent loop.
Bytes after the last tensor
GGUF headers define where tensor data ends. Loaders read weights up to that boundary and stop. Anything after is invisible to inference but still on disk (Malspark §2.2).
Mir2k placed a Windows program (ollie, described as a remote access trojan) after tensors, sometimes padded with hundreds of kilobytes so quick tail scans miss it, sometimes Deflate-compressed so file signatures disappear. The PowerShell prefix from the poisoned template reads those bytes back out of the same GGUF path and executes them — the model file is both weights and dropper.
Safetensors loaders, by contrast, reject files that are not exactly filled by declared tensors, which is why Malspark treats the post-tensor append as primarily a GGUF issue. Template poisoning still matters for tokenizer_config.json on other formats.
GGUF malware scan showing poisoned chat template metadata on a Hugging Face model card
Mir2k and timdedid: what Malspark attributes to each
Malspark names two operator clusters in the November 26–27, 2026 scan.
| Campaign | Repos (per disclosure) | Mechanism | User action required |
|---|---|---|---|
| Mir2k | 2 uncensored-style GGUF models | ollie RAT after last tensor + template prints unpack line | Run the printed PowerShell |
| timdedid | 3 models (e.g. cyber-uncensored naming) | Template hijack for agent shell workflows | Agent or user executes fetched script |
Downloads totaled 2,428 across all five. Hugging Face metrics count pulls, not infections: Malspark stresses that execution still depends on someone or something running the suggested command. The risk rises when agents auto-run terminal tools on model output.
For background on why the Hub is a high-value target, see our Qwen download scale coverage and Transformers GGUF performance notes — speed gains do not remove provenance duty.
What gguf-radar checks
Root0ne ships gguf-radar to inspect files without executing them. Malspark lists capabilities:
- Parse
tokenizer.chat_templatefor suspicious directives and trigger logic - Detect trailing bytes, padding tricks, zero-scale steganography blocks, and ZIP polyglots in test samples
- Emit YARA rules and MITRE mappings in the full write-up
sanitizepath: rebuild a GGUF with unchanged weights and stripped malicious metadata or tail bytes
For teams already standardizing on llama.cpp, pair static scans with the version hygiene we outline in local model runtime guides — old runtimes will not fix a poisoned file you already downloaded.
Practical pipeline before production
- Pin org, commit, and file hash — avoid “latest” on squat names (
qwen3.8-cyber-uncensoredstyle). - Run gguf-radar (or internal equivalent) in CI when a model artifact changes.
- Diff
tokenizer.chat_templateagainst a known-good export from the upstream lab when possible. - Deny auto-exec of model-printed shell one-liners in agent harnesses; require human approval (loop engineering for agents).
- Re-scan mirrors in object storage — S3 copies retain poisoned tails.
How this compares to earlier Hub malware waves
Hugging Face has seen impersonation repos and pickle exploits for years. A 2024 HiddenLayer report described a fake OpenAI-named project with hundreds of thousands of downloads and an infostealer in Python loaders — a different delivery path than in-GGUF templates.
What changed in November 2026 is specificity to GGUF + local inference + agents:
- Attackers target developers who skip Python
pip installand only drop a.ggufinto Ollama or llama-server - Chat templates become the social-engineering layer for coding agents that trust “system” blocks
- Scale is smaller in download count (2,428 vs six-figure pickle campaigns) but higher intent per victim when agents execute commands
Hugging Face’s own security tradeoff essay framed openness vs scanning costs; this incident is the local-weight version of that tension.
Open-weight model supply chain from download to agent tool execution
What the disclosure emphasizes
Malspark and prior GGUF-template research (for example Pillar Security’s July 2025 write-up, cited in the post) stress the same builder takeaway: loaders stop at the last tensor, so anything appended afterward stays on disk but off the inference path until something else reads it. Static tail audits and template diffs belong in the workflow before llama-server loads a new file.
Malspark’s author argues downloads are a lower bound on exposure because mirrors and offline shares are invisible to Hub metrics. That matches how supply-chain typosquats spread outside official store counts.
What Hugging Face users should do now
If you already pulled one of the named repos, stop serving it, delete local copies, rotate secrets on that host, and inspect browser and API keys. Malspark published indicators and YARA in its long-form post — use those for disk hunts.
If you distribute GGUF internally, add gguf-radar (or your vendor scanner) to the release job that uploads artifacts. Document template diffs in changelogs the same way you would for weight updates.
If you build agents, treat model output that contains PowerShell, curl, or wget lines as untrusted unless a human pins the command. For production agent deployments, AgentBeam helps stop agents from executing dangerous tool calls — the same failure class as trusting a poisoned template.
For enterprise buyers, this is another reason Hub Marketplace billing does not replace artifact review — procurement convenience is not malware control.
Is my downloaded GGUF safe to load?
There is no Hub badge that guarantees a file is clean. Malspark’s methodology scanned every public repository metadata surface it could reach at scan time, then deep-read suspicious GGUF tails and templates. Your workstation needs a smaller version of that habit:
Check provenance first. Prefer models from the lab that trained them, with signed release posts. Forks that add “uncensored” or version numbers that do not match any official card should trigger extra review — several timdedid names followed that pattern in the disclosure.
Static scan before load. Clone gguf-radar and run its inspect command on the file path your runtime will open. You are looking for two red flags: (a) template strings that mention system directives, PowerShell, or download URLs, and (b) file size larger than tensor math predicts. Malspark’s Mir2k samples used padding so a naive tail -c 4096 check would miss payloads.
Never pipe model text to a shell. If a local model prints a one-liner “fix,” paste it into a review buffer, identify what filesystem paths it touches, and assume compromise if it reads from the GGUF path itself. Agent frameworks that auto-approve “obvious” fixes are the threat multiplier timdedid targeted.
Rotate after exposure. If you already served a named malicious repo, treat the host as untrusted until you rotate API keys, SSH keys, and browser profiles on that machine. The ollie family Malspark describes behaved like commodity RAT tooling aimed at broad credential theft, not mining alone.
Report upstream. Hugging Face’s community reporting flow is the official removal path. gguf-radar’s YARA rules help security teams hunt mirrors in artifact stores that never hit public download counters.
Teams training staff on corporate AI adoption should add model artifact review beside prompt policy — the attack does not touch cloud APIs if weights never leave a laptop.
Related reading
- Hugging Face security tradeoffs in open platforms
- Transformers and llama.cpp GGUF parity
- Backdoored small models and Codex env risk
- What is MCP for agent tools
- Qwen family download scale
- LLM directory hygiene
- Fake Claude app and RevStealer wallet malware
GGUF layout details, download totals, and campaign names follow Root0ne’s Malspark post and gguf-radar repository as of November 27, 2026. Hugging Face removal status may change after publication.
