Vibeleaderboard
← All Intel
Intel / article

GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims

Source
malspark.com
Author
homarp
Date

Context

A local is usually shared as a GGUF , and each one carries a chat template, a small Jinja2 that the runtime applies to every conversation to build the exact text the model reads. A Malspark report by a researcher who signs as Düzgün describes real attacks that abuse that template and, in one campaign, the model file itself. A scan of all 3,273,389 public Hugging Face model repositories on 26 November 2026 found five malicious GGUF models from two accounts, downloaded 2,428 times as of 27 November. The headline's 2,400 victims is a download count. The report itself says Hugging Face counts downloads rather than people, so affected users number at most that, and it reports no confirmed infections.

The template attacks do not break out of the runtime, since C++ runtimes render templates in a restricted engine. They use ordinary template logic to add text the user never sees in the chat window. In three models from an account called timdedid, byte-identical copies of a small Qwen3 model aimed at security users, a message containing the words What is makes the template insert a fake system directive telling an agent with a PowerShell tool to download a script from a WordPress site and run it in a hidden window. That second-stage script was not recovered, so what it would have installed is unknown. The larger campaign, from an account called Mir2k, adds a trick specific to GGUF. The file's header and tensor table say exactly where the model data ends, runtimes such as llama.cpp and LM Studio never read past that point, and none of them warns about extra bytes. Mir2k appended a Windows program there, once followed by about half a megabyte of filler so scanners that check only the last few kilobytes see nothing, and once compressed so no recognizable file signature remains. Its two models were uploaded on 22 and 24 November with clean templates. On 26 November both templates were replaced so the model begins every reply with one PowerShell line which, if the user copies and runs it, reads the hidden bytes back out of the model file and starts them. Copies downloaded before 26 November contain the payload but not the trigger.

The unpacked program, which the author names ollie after the folders it creates, is a Windows remote access trojan carrying its own copy of Tor to reach its operator. By static analysis it exits if it detects a virtual machine or , keeps itself running through a scheduled task and watchdog processes, sends saved passwords from Chrome, Edge and Brave, targets the Phantom and MetaMask wallet extensions, supports keylogging, screenshots and webcam capture, and mines Monero when the machine is idle. The author notes that each half of the method has earlier lab work, with Pillar Security showing hidden instructions in GGUF templates in July 2025, but found no earlier public report of Mir2k's combination in a real attack. Chat templates also ship with Safetensors and PyTorch models in separate files, so the template half applies to those formats. The appended-bytes half does not, because the safetensors loader refuses a file whose declared tensors do not fill it exactly.

The report's advice for people running community models is to treat any command a model suggests as untrusted, and, when the model has tools, to supply a reviewed template through llama.cpp's --chat-template-file option or an Ollama Modelfile's TEMPLATE setting so the embedded one is never used. The author has also released gguf-radar, an open-source tool that inspects templates without running them, flags bytes after the last tensor and other hiding places, and rebuilds a clean file with the weights unchanged; the tests showing that it works are the author's own. The author argues that model hubs and runtimes could end the appended-payload method outright by rejecting GGUF files with bytes after the last tensor or non-zero padding. As of 27 November, the report says, all five repositories were still online.

Terms in this piece · Glossary
  • Large language model — A model trained on large amounts of data to process and generate language.
  • File — A named unit of stored data that keeps its contents while no program is using it.
  • Program — A set of instructions stored so that a computer can run it.
  • Sandbox — An enforced restriction that confines a process to specified files, network destinations and other resources, applied by the operating system, a container or a virtual machine.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Read the source malspark.com
Tools in this story
Recommended reads