Vulnerability  ·  2026-11-30

Real-world malware hidden in GGUF models on Hugging Face (chat-template poisoning + payload appended after last tensor)

VulnerabilityHigh impactGlobal
A Nov 28, 2026 scan of all 3,273,389 public Hugging Face model repositories found five malicious GGUF models (2,428 downloads) from two actors. The larger 'Mir2k' campaign appended a complete Windows remote-access trojan after the final tensor in a working GGUF file (a region no inference runtime reads), then rewrote the file's tokenizer.chat_template days later so the model itself instructed users to unpack and run it. A second 'timdedid' set used the agent-hijacking variant: a trigger phrase in the user's message made the template inject a fake [SYSTEM DIRECTIVE] block telling any agent with shell access to download and run a remote script.
This is the first confirmed in-the-wild use of chat-template poisoning combined with the GGUF 'appended-bytes' trick on a public model hub, and it defeats the Python-pickle defenses most registries focus on. The model file is simultaneously the weights, the dropper, and the delivery vector: a user (or a coding agent/tool-using assistant) only has to download the model and run it. It directly attacks the local-model supply chain (llama.cpp, Ollama, LM Studio) and the growing 'agent on top of a local model' deployments. Note: pending the Nov 28 scan, this crosses the standing 'recently-covered' practice of citing earlier lab template-poisoning work — this is the first real-world confirmed use.
Supply-chain: a malicious GGUF model is downloaded and loaded; its poisoned chat template (running on every inference call in the unmonitored gap between input and model processing) injects instructions that trigger execution of an embedded RAT or a remote script by the user or an agent loop.
GGUF (GPT-Generated Unified Format) local-inference model distribution on Hugging Face; runtimes llama.cpp, Ollama, LM Studio; two actors (Mir2k, timdedid) — 5 malicious model repos
Do not trust model chat templates from unverified repos; verify checksum/source, use a sandbox for template rendering and agent execution, and inspect GGUF files for data appended after the declared tensor ranges (or re-quantize/re-package the model). Platform: enable automated GGUF/template scanning rather than only pickle/PyTorch serialization checks.
Product Watch — Hidden Malware in GGUF Models on Hugging Face Reached 2,400+ Downloads
See this in the live feed Explore related AI security and governance findings — updated every morning.
Open the feed →