Over the past few days, a set of attacks discovered on Hugging Face has revealed a compromise technique that exploits two blind spots of the GGUF format — the most widely used container for local language models — and puts millions of people who run local AI at risk. The analysis was conducted by researcher Düzgün from Malspark, who scanned all 3,273,389 public Hugging Face repositories on November 26 and found five malicious models with a combined 2,428 downloads.
What makes this case particularly interesting is not just the download volume, but the sophistication of the attack. The attackers discovered that GGUF allows two ways to hide malicious code: first, by abusing the chat template (the conversation template that every GGUF file carries as Jinja2 metadata) to inject instructions that the user never sees in the chat interface. Second, by appending an executable program after the last tensor in the file — something that GGUF parsers silently ignore because they strictly follow the boundaries declared in the header.
The format that was supposed to be safe
GGUF (GPT-Generated Unified Format) has become the de facto standard for distributing local quantized models. Unlike PyTorch's pickle format, which permits arbitrary code execution by design, GGUF is a binary container that carries weights and metadata in a single file. The format does not execute code — or rather, it should not.
The GGUF structure consists of three parts: a header with a magic number (0x47475546), tensor count, and metadata count; a metadata table with key-value pairs that includes architecture parameters and the chat template; and tensor data with quantized weights. Runtimes like llama.cpp and LM Studio read only the byte ranges defined by the header. Anything after the last tensor is ignored.
It was precisely this design feature — ignoring bytes after the last tensor — that the attackers exploited. The Safetensors format, created as a safer alternative, does the opposite: its loaders reject files that don't exactly fill the declared tensors. GGUF doesn't make that check.
The Mir2k campaign: plant first, arm later
The most significant campaign, dubbed Mir2k by Malspark, operated in two distinct phases. On November 22, the Mir2k account uploaded two GGUF models — Huihui-Qwen3.5-9B-abliterated and Inkling-2-Mini-Uncensored — already with a Windows remote access trojan named ollie appended after the last tensor. The chat templates, however, were clean. The payload was there, hidden, but had no trigger.
Two to four days later, on November 26, the attackers rewrote the templates. The new version added a French instruction that forced the model to start every response with a PowerShell line. That line read the final bytes of the GGUF file itself, decompressed the payload with Deflate, wrote it to %TEMP%\d.exe, and executed it.
The ollie implant is an 11.47 MB Windows x64 program. About 10.25 MB is a complete copy of the Tor client 0.4.9.16, which routes traffic to an onion service controlled by the operator. Static analysis revealed capabilities ranging from password theft (Chrome, Edge, Brave) to access to wallet extensions (Phantom and MetaMask), keystroke logging, screen and webcam capture, and background Monero mining. The program protects itself with watchdog processes and registers as a critical process in Windows — meaning killing it crashes the system.
The timing is especially disturbing: versions downloaded before November 26 contained the payload but not the trigger. Users who downloaded afterward could have run the command without realizing it.
The timdedid campaign: focused on coding agents
The second operator, timdedid, took a different approach. On November 21 and 22, it published three identical copies of a Qwen3 1.7B model aimed at security users, plus a mirror on Ollama. The chat template injected a fake system directive whenever the user's message contained the phrase "What is". That directive ordered an agent with shell access to download and execute a remote script via PowerShell.
Unlike Mir2k, timdedid did not append an executable to the file. Instead, it exploited the pattern of coding agents — tools like Cursor, Claude Code, and others that automatically execute terminal commands. The script itself was never recovered by researchers, so its actual impact remains unknown. The three repositories had 482 combined downloads at the time of the scan.
Why scanners missed it
One of the most disturbing aspects of the attack was its ability to slip past conventional security scanners. In Malspark's analysis, both antivirus engines and pickle scanners raised zero alerts on the Mir2k files. Standard GGUF parsers loaded the files without any complaints. Neither the file hash nor the campaign strings had public records at the time of the report.
This happens because the attack operates in two layers. The payload hidden after the last tensor is invisible to signature scans because it's not in the byte ranges any runtime reads. The chat template, meanwhile, is a restricted Jinja2 program running in a C++ engine — it doesn't execute system code, it just injects text into the conversation.
Malspark created an open-source tool called gguf-radar to address this specific problem. The tool analyzes chat templates without executing them, detects hidden bytes after the last tensor, and rebuilds clean GGUF files while keeping the weights unchanged. For teams already using llama.cpp, gguf-radar can be integrated into CI pipelines as a mandatory check before loading third-party models.
The problem is bigger than it appears
Academic research published in February 2026 already mapped chat templates as an inference-time attack surface. The paper "Inference-Time Backdoors via Chat Templates" demonstrated that malicious templates remain dormant under benign inputs and activate reliably when specific triggers appear — without modifying weights, training data, or deployment infrastructure.
The article also noted that, as of April 2026, Hugging Face alone hosted over 1.8 million GGUF files across approximately 180,000 model repositories. GGUF accounted for approximately 89.5% of quantized distributions on the platform. That means a significant fraction of all locally available models has an embeddable chat template that could be tampered with.
What has changed since then
As of this writing, Hugging Face has disabled all five malicious repositories on November 28. However, the i10X News team verified that the timdedid copy was still live on Ollama with 42 downloads. Ollama doesn't apply an extra template layer — the template embedded in the model weights remains as an attack vector.
Malspark published YARA rules, mapping to MITRE ATT&CK (12 tactics), and a complete mapping to MITRE ATLAS. Indicators include the ollie implant SHA-256 hash, campaign strings, and template patterns that can be ingested into SIEMs and EDRs.
What this means for the local AI industry
This attack reveals a structural flaw in the trust model of language model supply chains. For years, the standard recommendation was: "use GGUF instead of pickle, because GGUF is just data." Mir2k shows that distinction is false. GGUF does not contain executable code in the traditional sense — but its chat template injects text that, when executed by the user or an agent, triggers code execution on the system.
The implication is broader: as local AI agents gain shell access and system tool access (which is already common in development setups), every model downloaded from a public repository becomes a potential compromise vector. The problem doesn't stop at GGUF — the same academic paper documented similar techniques in Safetensors through tokenizer_config.json, and PyTorch models with malicious config.py have already been targeted in attacks reported by JFrog in November 2026.
The question is: when a file format that is supposedly safe becomes as sophisticated an attack surface, is the responsibility the format's, the distribution platform's, or the person who decides to load models from public repositories without verification? With more than 3 million repositories and the trend of autonomous agents executing commands based on prompts, the answer is becoming increasingly clear.
Sources: Malspark, i10X News, Spectrum Security
✓ Independent sources cross-checked and verified before publishing