Hugging Face Pulls Malicious GGUF Models, Ollama Mirror Stays Live
Hugging Face disabled five GGUF repos hiding a Windows trojan and poisoned chat templates after 2,807 downloads, but an Ollama mirror stayed online.
Hugging Face disabled five malicious GGUF model repositories on November 28 after security researchers uncovered two active campaigns hiding Windows malware and agent-hijacking directives inside files widely assumed to be safe from code execution. Yet a verification check the same day found an armed mirror still live on Ollama's public registry, exposing a structural gap across local LLM distribution hubs.
What Happened and Key Numbers
On November 28 at 13:22 UTC, Hugging Face disabled five repositories linked to two threat actors—Mir2k and timdedid—after their combined download counters climbed from 2,428 in Malspark's initial report to 2,807 before takedown, according to i10X. Malspark scanned all 3,273,389 public Hugging Face model repositories—including 226,310 GGUF repos holding 2.56 PB of weights—and statically parsed 572,184 chat templates.
Despite the Hub takedown, i10X confirmed on Saturday that timdedid/qwen3-1.7b-cyber remained downloadable on Ollama with 42 pulls and its poisoned template intact. Meanwhile, Mir2k had already pre-created 12 empty placeholder repositories named after anticipated releases such as Qwen4-27B, DeepSeek-V4, Llama-4-Scout, and gemma-4-27b.
How Attackers Bypassed "Code-Free" GGUF Safety
For years, local AI engineers avoided Python .pkl checkpoints in favor of GGUF and Safetensors because those formats store tensors and metadata rather than executable pickle opcodes. Neither campaign exploited a bug in llama.cpp or LM Studio; instead, both weaponized two valid features of the format.
First, Mir2k appended an 11.47 MB Windows x64 trojan (ollie, bundling a 10.25 MB Tor client, browser/wallet stealer, and Monero miner) after the final tensor—once padded with ~0.5 MB of filler and once compressed with raw Deflate so antivirus signatures failed. Because GGUF loaders stop reading at the end of the last declared tensor, the model loads normally. Second, two to four days after upload, Mir2k edited tokenizer.chat_template so the model opens every reply with a PowerShell one-liner that carves %TEMP%\d.exe out of the .gguf file on disk. Separately, timdedid injected a [SYSTEM DIRECTIVE] triggered by "What is" to make coding agents call a PowerShell tool and fetch a hidden second-stage script.
Context: Why Local Model Supply Chains Are Failing
This incident arrives alongside rising supply-chain pressure on agentic tooling, where attackers target the gap between static weight validation and runtime prompt execution. Unlike Safetensors—whose loader rejects files when declared tensors do not fill the exact byte length—GGUF parsers ignore trailing bytes, general.alignment padding gaps, and zero-scale Q8_0 blocks (0x8000 negative zero), which Malspark also demonstrated can hide ZIP polyglots or arbitrary payloads without altering a single dequantized weight (Malspark).
Because Mir2k uploaded clean templates first and armed them days later, point-in-time scans at upload miss delayed activation. Mirror registries like Ollama also lack synchronized takedown propagation when upstream Hugging Face repos are banned.
Macro and Micro Consequences
At the ecosystem level, model hubs can no longer rely solely on pickle scanners and hash checks. Strict structural validation—rejecting trailing EOF bytes and non-zero padding—will become baseline registry hygiene.
For developers and security teams running local LLMs, immediate hardening steps are straightforward:
- Purge and scan local weights: Delete any
Mir2kortimdedidmodels and run open-source gguf-radar (gguf-radar scan/sanitize) to strip trailing bytes and inspecttokenizer.chat_templateASTs without altering weights. - Pin external chat templates: Override embedded templates using
--chat-template-fileinllama.cppor an explicitTEMPLATEin Ollama Modelfiles, especially when connecting coding agents with shell access. - Gate internal registries: Run
gguf-radarin CI pipelines before community weights reach developer laptops.
Winners and Losers
Security tooling vendors and Safetensors-first workflows gain urgency as enterprises realize "weights-only" formats still carry prompt-injection and polyglot risks. Community hubs like Hugging Face and Ollama face operational pressure to enforce strict GGUF canonicalization and cross-hub takedown coordination, while developers who blindly pull day-one "uncensored" quantizations carry the highest risk.
What to Watch Next
Watch whether Hugging Face and llama.cpp ship strict rejections for trailing post-tensor bytes and non-zero alignment padding, whether Ollama removes timdedid/qwen3-1.7b-cyber and audits mirrored templates, and whether attackers reuse Mir2k's 12 pre-staged placeholder names during upcoming flagship model launches.
// comments (0)