Open Source Published here Reported by Malspark on

Five GGUF models on Hugging Face hid a Windows RAT after the last tensor — 2,428 downloads

Malspark published a scan on November 27 of 3,273,389 public Hugging Face model repositories, parsing 572,184 chat templates statically. Five GGUF repos came back malicious across two campaigns, with 2,428 downloads and all five still online that day. The technique is two halves. A GGUF header says where tensor data ends, and runtimes read only those byte ranges, so an 11.47 MB Windows implant appended after the last tensor loads invisibly and triggers no warning. The poisoned tokenizer.chat_template then tells the model to open every reply with one PowerShell line that reads those bytes back out of the model file and runs them.

Why it matters

Your scanners are looking in the wrong place. Antivirus and pickle checks gave no alert on every specimen, and llama.cpp and gguf-py loaded them normally, because nothing malicious sits in the weights — it sits in bytes no parser reads and in a template that only ever prints text. The timeline is the part I would take to a security review: the payload went up on November 22 with a clean template, and the trigger was added four days later, so anyone who downloaded early has the implant without the instruction. The template half applies to Safetensors and PyTorch too.

What to do

Pin the chat template yourself rather than using the one inside the file: pass --chat-template-file in llama.cpp or TEMPLATE in an Ollama Modelfile, which takes the embedded one out of the loop entirely. Then scan community GGUFs at the gate into your model registry, not on a developer laptop, checking for bytes after the last tensor. Treat any command a local model prints as untrusted input, especially one it asks you to paste.

Tags: Security Open Source Local Models

More from November 30, 2026

All AI news