Two models on Hugging Face carried a Windows trojan hidden after their weights
In a post dated 27 November, Malspark reports that a scan of all 3,273,389 public Hugging Face model repositories on 26 November found 5 malicious GGUF models with 2,428 downloads. Two actors misused the chat template stored in each file: one to make an agent download and run a script, the other to make the model print the command that unpacks a remote access trojan hidden after the last tensor.
Local models are usually shared as GGUF files. Besides the weights, each file carries a chat template, a small Jinja2 program that the runtime applies to the conversation before every reply to build the text the model reads. Runtimes such as llama.cpp and LM Studio read exactly the byte ranges the file's header points to and ignore everything else. The attacks in Malspark's post use both facts: a template that adds instructions the user never sees, and data appended after the last tensor, where no loader reads and no runtime warns.
The scan covered 226,310 GGUF repositories holding 2.56 PB of weights and parsed 572,184 chat templates without running them. In the largest campaign, Mir2k, a new account uploaded two uncensored models on 22 and 24 November, a Qwen3.5 9B fine-tune and Inkling-2-Mini-Uncensored-GGUF, each with the same Windows program appended and a clean template. On the morning of 26 November both templates were replaced with a system message, in French, telling the model to begin every reply with one PowerShell line. That line finds the largest .gguf file in the user's profile, reads its last bytes, writes them out as a program and starts it.
The program, which Malspark calls ollie, checks for virtual machines and sandboxes, keeps itself running with a scheduled task and watchdog processes, and reaches its operator over Tor. It sends passwords saved in Chrome, Edge and Brave, targets the Phantom and MetaMask wallet extensions, can log keys and capture the screen, and mines Monero while the machine is idle. A second actor, timdedid, published three copies of a small Qwen3 model for security users whose template, when a message contains the words "What is", inserts a fake system directive telling an agent with a PowerShell tool to download and run a script. Safetensors files cannot hide a program after their data, because that loader refuses a file whose tensors do not fill it exactly, but chat templates in other formats can carry the same hidden instructions.
All five repositories were still online on 27 November, and their downloads grew by more than half in one day. Malspark's open-source tool gguf-radar scans a GGUF file without running anything, flags suspicious templates and hidden bytes, and rebuilds a clean copy with the dequantized weights unchanged. The post also lists indicators, YARA rules and a MITRE mapping, and warns that antivirus engines that check only the last few kilobytes of a file miss the compressed payload.
The victim never downloads anything except the model itself.
