GGUF Malware on Hugging Face: Hidden Payloads and Chat-Template Poisoning Security researcher Root0ne published findings on November 27, 2026, identifying five malicious GGUF repositories on Hugging Face that combined chat-template poisoning with payloads hidden after model tensors, accumulating 2,428 downloads before disclosure in a scan of 3,273,389 public Hub models. The Mir2k campaign (2 repos) embedded a Windows remote access trojan named ollie after the tensors, while the timdedid campaign (3 repos) used agent-oriented templates that injected a fake [SYSTEM DIRECTIVE] block instructing shell-capable agents to download and execute a remote script. Root0ne released the open gguf-radar tool so developers running local weights in llama.cpp, Ollama, or agent harnesses can scan files before loading them. 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 https://malspark.com/blog/malicious-gguf-models-hugging-face/?ref=explainx and the open gguf-radar https://github.com/Root0ne/gguf-radar?ref=explainx 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 https://explainx.ai/blog/fake-claude-app-revstealer-crypto-malware-2026 and backdoored fine-tunes https://explainx.ai/blog/projectdiscovery-backdoored-qwen2-5-7b-under-50-dollars-codex-cli-env-credentials-abliterated-models-2026 — 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 → https://explainx.ai/agentbeam?src=blog note 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 https://malspark.com/blog/malicious-gguf-models-hugging-face/?ref=explainx | | 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 https://explainx.ai/blog/what-is-mcp-model-context-protocol-guide | 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 https://malspark.com/blog/malicious-gguf-models-hugging-face/?ref=explainx . 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 https://malspark.com/blog/malicious-gguf-models-hugging-face/?ref=explainx . 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 https://explainx.ai/blog/qwen-3-billion-downloads-most-downloaded-model-family-august-2026 coverage and Transformers GGUF performance https://explainx.ai/blog/hugging-face-transformers-gguf-llama-cpp-parity-2026 notes — speed gains do not remove provenance duty. What gguf-radar checks Root0ne ships gguf-radar https://github.com/Root0ne/gguf-radar?ref=explainx to inspect files without executing them. Malspark lists capabilities: - Parse tokenizer.chat template for 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 - sanitize path: 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 https://explainx.ai/blog/what-is-llama-cpp-run-models-locally-2026 — old runtimes will not fix a poisoned file you already downloaded. Practical pipeline before production 1. Pin org, commit, and file hash — avoid “latest” on squat names qwen3.8-cyber-uncensored style . 2. Run gguf-radar or internal equivalent in CI when a model artifact changes. 3. Diff tokenizer.chat template against a known-good export from the upstream lab when possible. 4. Deny auto-exec of model-printed shell one-liners in agent harnesses; require human approval loop engineering for agents https://explainx.ai/blog/loop-engineering-coding-agents-claude-code-guide-2026 . 5. 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 https://www.csoonline.com/article/4169407/malicious-hugging-face-model-masquerading-as-openai-release-hits-244k-downloads.html?ref=explainx 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 install and only drop a .gguf into 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 https://explainx.ai/blog/hugging-face-open-source-ai-security-tradeoff-solaiman-2026 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 https://explainx.ai/blog/fake-claude-app-revstealer-crypto-malware-2026 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 https://agentbeam.com/?ref=explainx 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 https://explainx.ai/blog/hugging-face-hub-google-cloud-marketplace-billing-2026 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 https://explainx.ai/workshops should add model artifact review beside prompt policy — the attack does not touch cloud APIs if weights never leave a laptop. Related reading 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.