GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims
Security researchers found five malicious GGUF models on Hugging Face that hid a Windows trojan behind model weights and gathered over 2,400 downloads.
By Dillip Chowdary • Nov 28, 2026 • Source: malspark.com

At a glance
- Affected format
- GGUF
- Repositories scanned
- 3,273,389
- Malicious repositories
- 5
- Total downloads
- 2,428
- Primary payload
- ollie Windows remote access trojan
- Inspection tool
- gguf-radar
In this post
Security researchers identified five malicious machine learning models distributed through Hugging Face that secretly carry remote access malware or malicious agent instructions, according to malspark.com's report. A comprehensive automated scan of 3,273,389 public model repositories on 26 November 2026 revealed that threat actors had embedded executable files directly inside GGUF format weights and modified conversation templates to trigger system compromise. Across the five weaponized repositories, download tallies reached 2,428 by 27 November 2026.
This report details how attackers manipulate GGUF file structures, deploy dormant payloads inside open source models, and weaponize inference templates across local runtimes. Machine learning engineers, security analysts, and enterprise teams running local models using llama.cpp or LM Studio can reference these mechanics to inspect model files and verify local weights.
01Jinja2 Templates And Trailing Tensor Executables
GGUF models store formatting instructions as Jinja2 programs inside the metadata table under the tokenizer.chat_template key. Model runtimes like llama.cpp and LM Studio evaluate this template on incoming prompts to assemble the exact text passed to the neural network. Attackers manipulate this logic so the template silently injects directives into the context window without showing those commands to the user in the graphical chat interface.
The file format also specifies tensor layouts where headers dictate boundary locations for model parameters, leaving subsequent bytes unread by model loaders. Threat actors place complete executable files in the unparsed space after the final tensor. While Safetensors runtimes reject files with undeclared trailing bytes, standard GGUF loaders ignore unmapped appended trailing bytes completely.
Note: Local inference runtimes render chat templates in restricted C++ engines without Python environments, preventing classic template injection escapes directly into the operating system.
02Public Repository Scan Across Hugging Face
Security researchers analyzed 226,310 GGUF repositories representing 2.56 petabytes of weights across Hugging Face using selective HTTP Range requests. The audit parsed 572,184 chat templates statically to locate hidden directives and anomalies. Researchers excluded legitimate research models and security tests, leaving five active malicious repositories operated by two independent threat actors.
| Repository | Campaign | Method | Downloads |
|---|---|---|---|
| Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF | Mir2k | Reply prefix with hidden executable | 1488 |
| Mir2k/Inkling-2-Mini-Uncensored-GGUF | Mir2k | Reply prefix with compressed executable | 458 |
| timdedid/qwen3.8-cyber-uncensored | timdedid | Tool hijacking directive | 271 |
| timdedid/qwen3-cyber-UNCENSORED-2 | timdedid | Tool hijacking directive | 136 |
| timdedid/qwen3-cyber-UNCENSORED | timdedid | Tool hijacking directive | 75 |
Repository downloads expanded from 1,502 on 26 November to 2,428 downloads within twenty-four hours across the catalog. The second campaign, timdedid, deployed templates containing trigger phrases that activate hidden system directives whenever specific text appears in user prompts. Those injected instructions target autonomous coding agents with shell access, attempting to force automated script retrieval.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
03Mir2k Staging Timelines And Empty Placeholders
The Mir2k threat actor created an initial footprint on 22 November 2026, registering fourteen new repositories with French language metadata strings and model cards. Twelve repositories remained empty placeholders named after unreleased architectures including Qwen4-27B, DeepSeek-V4, Llama-4-Scout, and gemma-4-27b to prepare for future releases. The campaign uploaded Huihui-Qwen3.5-9B-abliterated on 22 November and Inkling-2-Mini-Uncensored on 24 November with clean chat templates.
- Payload placement The operator uploaded GGUF models containing appended executable bytes while keeping chat templates benign during initial distribution.
- Fixed path update On 26 November 2026 the actor replaced templates to output commands targeting fixed file locations in user Downloads folders.
- Dynamic path expansion Nine hours later the actor revised templates again with PowerShell routines that search entire user profiles for the largest model file.
Victims who obtained model files before 26 November received dormant malware without active execution triggers inside the original chat templates. Modifying templates days after distribution allowed the operator to bypass security checks applied during initial uploads while weaponizing existing local files.
04PowerShell Triggers And In-Memory Deflate Payloads
The armed Mir2k template injects a French directive instructing the model to preface every answer with a designated PowerShell command. When users copy and run model responses, the extracted PowerShell command locates the largest GGUF file in user directories and carves the appended executable into the temporary directory as d.exe. The extracted binary deploys the ollie Windows remote access trojan.
The Huihui model carries an uncompressed Windows executable followed by approximately half a megabyte of filler bytes, bypassing basic antivirus utilities that inspect only file endings. The Inkling model stores the identical payload compressed with raw Deflate algorithms to strip recognizable executable signatures. The generated PowerShell invocation uses IO.Compression.DeflateStream to decompress 4,200,000 bytes into system memory before disk extraction.
05Detection Deficits And Open Source Gguf-radar
Conventional endpoint security tools struggle to identify appended payloads because scanning tools frequently evaluate only the final kilobytes of massive multi-gigabyte model archives. The Deflate compression applied in the Inkling distribution further blinds static file signature detection engines. Security analysts must verify GGUF headers directly against reported tensor offsets to uncover unmapped byte ranges.
The open source security utility gguf-radar inspects GGUF headers, tensor boundaries, and Jinja2 templates without executing local code or initializing neural network weights. The tool isolates unmapped byte ranges, extracts hidden binaries for analysis, and reconstructs clean GGUF files by stripping trailing data while preserving model parameters intact.
Frequently asked questions
What is chat template poisoning in GGUF models?
Chat template poisoning abuses the Jinja2 template in a GGUF file to inject covert instructions into conversation prompts without displaying them to the user.
How do malicious GGUF files hide executable binaries?
Attackers append executable data after the final tensor boundary where model loaders ignore extra bytes, evading file size and tensor alignment checks.
Which Hugging Face repositories contained the malicious files?
The scan identified five repositories across the Mir2k and timdedid accounts, including Huihui-Qwen3.5-9B-abliterated-GGUF and Inkling-2-Mini-Uncensored-GGUF.
How can engineers detect and clean infected GGUF files?
Security teams can scan model metadata and trailing bytes with the open-source gguf-radar utility, which removes hidden binaries while keeping weights intact.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement