Warning: How Uncensored GGUF Models on Hugging Face Hid the 'Ollie' Stealer and Agent Backdoors
Security research from Malspark and Corgea (November 2026) uncovered two active supply-chain campaigns on Hugging Face—Mir2k and timdedid—that weaponized GGUF files without Python pickle. Attackers appended the 'Ollie' Windows info-stealer past the tensor weights and armed Jinja2 chat templates to trick users and coding agents into executing payloads.
- Mir2k campaign: appended the 'Ollie' info-stealer (targeting browsers, session tokens, and crypto wallets) to trailing GGUF bytes, then updated the Jinja2 chat template days later to print an obfuscated PowerShell extractor.
- timdedid campaign: poisoned chat templates specifically targeting autonomous AI coding agents with shell access, forcing them to download and run external scripts.
- Standard inference loaders (llama.cpp, LM Studio, Ollama) ignore trailing bytes past tensors, so poisoned models chat normally while carrying hidden payloads.
- Audit tokenizer.chat_template before loading, scan files with tools like gguf-radar for trailing-byte anomalies, and never give untrusted models host shell access.
How the GGUF Supply-Chain Attack Works
Unlike older Hugging Face attacks that relied on Python pickle deserialization, the November 2026 campaigns flagged by Malspark and analyzed by Corgea targeted GGUF—the format widely assumed to be safe for llama.cpp, LM Studio, and Ollama.
The attackers exploited two overlooked facts: GGUF files embed Jinja2 chat templates evaluated on every prompt, and inference loaders silently ignore trailing data appended after the tensor weights.
| Campaign | Target | Attack Mechanism |
|---|---|---|
Mir2k | Human desktop users | Uploaded clean-looking GGUFs with the "Ollie" Windows info-stealer appended to trailing bytes. Days later, modified the Jinja2 chat template to prepend an obfuscated PowerShell command that extracts and runs the hidden binary. |
timdedid | Autonomous AI coding agents | Embedded malicious system directives in the chat template to hijack agents with terminal/tool permissions, instructing them to fetch and execute remote scripts. |
Why Platform Moderation Misses It
Hugging Face disabled the reported repositories once disclosed, but mirrors lingered briefly on third-party hubs. Because a poisoned chat template can be pushed days after initial upload—and because behavioral triggers are not traditional executable signatures—blindly trusting community "uncensored" repacks is unsafe.
4-Step Defense Checklist for Local Models
- Stick to verified publishers: Download official repos (Qwen, Meta, Google, Mistral, DeepSeek) or established quantizers (
ggml-org,bartowski,unsloth). - Scan for trailing bytes & inspect templates: Run a GGUF scanner such as
gguf-radarand inspecttokenizer.chat_templatebefore loading unknown uploads. - Treat chat templates as code: Never blindly copy-paste or auto-execute shell commands emitted by a model.
- Isolate untrusted models: Run experimental or uncensored fine-tunes inside a disposable container (
--network=none) or dedicated VM with zero access to~/.ssh, browser profiles, or crypto wallets.
Frequently Asked Questions
Can a GGUF model file contain malware even though it does not use Python pickle?
Yes. Attackers in the Mir2k and timdedid campaigns appended hidden Windows executables (the Ollie info-stealer) to trailing bytes past the tensors and used GGUF Jinja2 chat templates to instruct users or coding agents to execute payloads.