5 poisoned GGUF models hid a RAT after the last tensor — and armed it 4 days later
A scan of 3.27M Hugging Face repos found 5 malicious GGUF models with 2,428 downloads. The payload rode inside the file for days before its trigger existed.
Local-model supply chain just got its first end-to-end campaign, and the part that matters is not the malware — it's the schedule. The Windows RAT sat inside two Hugging Face model files, inert, for four days before the code that activates it was written. Plant first, arm later. That's a discipline, and disciplines scale.
The loader contract is the vulnerability
Every GGUF file carries a chat template — a Jinja2 program the runtime applies to every prompt — and runtimes like llama.cpp read exactly the byte ranges the header points to. Bytes after the last tensor are never read, never warned about, and never change model behavior. So they can hold anything. Safetensors refuses a file whose tensors don't fill it exactly; GGUF has no such check. The researchers' clean rebuilds prove the point: strip the overlay and the dequantized weights are identical, which means the model card tells you nothing about the file's cargo.
| Repository | Campaign | Method | Downloads |
|---|---|---|---|
| Mir2k/Huihui-Qwen3.5-9B-abliterated | Mir2k | Reply prefix + hidden executable | 1,488 |
| Mir2k/Inkling-2-Mini-Uncensored | Mir2k | Compressed payload + reply prefix | 458 |
| timdedid/qwen3.8-cyber-uncensored | timdedid | Agent tool hijacking | 271 |
| timdedid/qwen3-cyber-UNCENSORED-2 | timdedid | Agent tool hijacking | 136 |
| timdedid/qwen3-cyber-UNCENSORED | timdedid | Agent tool hijacking | 75 |
- Nov 21–22timdedid uploads three byte-identical Qwen3 1.7B "cyber" models with a hijack trigger wired into the template.
- Nov 22Mir2k uploads the first model — RAT already appended, template clean. Inert.
- Nov 24Second Mir2k model, payload now Deflate-compressed to kill file signatures.
- Nov 26Both templates rewritten within an hour: every reply must start with a PowerShell one-liner that unpacks the tail bytes and runs them.
- +9 hoursTemplates rewritten again to search the whole user profile for the model file.
What the payload actually does
The RAT — named "ollie", folder chosen to sit next to Ollama in AppData — is mostly a complete copy of Tor (10.25 MB) plus a Monero miner. It checks for VirtualBox, VMware and Sandboxie and exits if found. On a real machine it installs a scheduled task running every 10 minutes with highest privileges, marks its process critical so killing it bluescreens Windows, exfiltrates saved passwords from Chrome, Edge and Brave over an onion service, targets the Phantom and MetaMask wallet extensions, and does keylogging, clipboard, screenshots and webcam on demand. The craft has holes — its UAC bypass was compiled without backslashes and fails, its Run key path too — which is almost worse: competent exfiltration, sloppy persistence, still fully functional.
The second campaign targets coding agents specifically
- timdedid's models are aimed at security users; the README tells you not to replace the embedded template.
- When your message contains "What is", the template inserts a fake [SYSTEM DIRECTIVE] ordering an agent with a powershell tool to download value.ps1 from a WordPress site and run it hidden.
- The second stage was never recovered — the campaign is a loaded gun nobody has fired in public yet.
- Treat model-suggested commands as untrusted. The attack's last hop is always a user or agent choosing to run a line. That's the only hop you fully control.
- Override the template. A reviewed template via
--chat-template-filein llama.cpp orTEMPLATEin an Ollama Modelfile takes the embedded one out of the loop entirely. - Gate models structurally. gguf-radar parses templates into a syntax tree without running them, flags EOF overlays, and exits non-zero so CI can refuse the file. It rebuilds clean copies with weights unchanged.
- Push the fix upstream. If hubs rejected GGUF files with bytes after the last tensor, Mir2k's whole method dies. That's the ask worth filing.
Same vein as last week's malicious crates masquerading as typo-squats — the hub is the new registry, and registries are attack surface.
- malspark.com — the scan, campaigns, and payload analysis, Nov 27
- github.com/Root0ne/gguf-radar — detector and clean rebuilder, MIT
- huggingface.co — the five repositories, still online at writing time
the radar reads hundreds of sources so you don't have to — the feed · the digest, nightly 21:00