# Malicious GGUF Models on Hugging Face Carry Windows RAT 'ollie' via Chat Template Poisoning and Post-Tensor Payload Hiding

> Malspark scanned 3,273,389 public Hugging Face repositories on 26 November 2026 and found five malicious GGUF models (2,428 downloads as of 27 November) that behave as normal local LLMs while hiding a Windows x64 RAT ('ollie', embedding Tor 0.4.9.16) after the last tensor. Poisoned Jinja2 chat templates (tokenizer.chat_template) make the model print a PowerShell unpack-and-run line, or inject a fake [SYSTEM DIRECTIVE] that orders an agent to download and run a hidden script.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-01T11:54:16Z
- **Last updated:** 2026-12-01T14:47:21.915Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7168
- **ID:** TL-2026-7168
- **Severity:** HIGH
- **Category:** SUPPLY_CHAIN
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 41 (3 shown free below)

## Description

Malspark's static scan of 3,273,389 public Hugging Face model repositories (226,310 GGUF repositories, 572,184 chat templates parsed) on 26 November 2026 identified five malicious repositories from two accounts, Mir2k and timdedid. Hugging Face counted 2,428 downloads across the five repositories as of 27 November (1,502 on 26 November); downloads count files fetched, not unique victims, and do not by themselves establish infection. Antivirus and pickle scanners raised no alerts and standard GGUF parsers loaded the files normally.

Campaign 1 (Mir2k): the account created 14 repositories on 22 November, twelve of them empty placeholders named for anticipated releases (e.g. Qwen4-27B, DeepSeek-V4, Llama-4-Scout, gemma-4-27b). Two uncensored models carried the payload: Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF (1,488 downloads; plain Windows executable appended after the last tensor, preceded by roughly 0.5 MB of filler) and Mir2k/Inkling-2-Mini-Uncensored-GGUF (458 downloads; the same executable compressed with raw Deflate to remove recognizable file signatures). GGUF loaders ignore bytes after the last tensor, so the models function normally. Payloads were uploaded on 22 and 24 November with clean chat templates. On 26 November both templates were rewritten (first reading a fixed path under Downloads, then about nine hours later searching the whole user profile for the largest .gguf file). The armed template adds a French system message instructing the model to begin every reply with a line copied character by character. That line is a PowerShell command that reads the trailing bytes of the largest .gguf (Huihui: 11,474,944 bytes starting 12,000,000 bytes before end of file; Inkling: last 4,200,000 bytes, decompressed in memory with IO.Compression.DeflateStream) and writes them to %TEMP%\d.exe, then starts it. Execution therefore depends on the user copying and running the model-printed command. Downloads made before 26 November contain the payload but not the trigger.

The 'ollie' implant is an 11.47 MB Windows x64 program, of which about 10.25 MB is an embedded Tor 0.4.9.16 executable (starting at offset 0x000E88A0). It exits if it detects VirtualBox, VMware or Sandboxie drivers or usernames such as sandbox, malware and test. Persistence uses a scheduled task running every 10 minutes with highest privileges, two watchdog processes, StartupApproved registry keys, and marking the process critical so that terminating it crashes Windows. Its fodhelper.exe UAC bypass (HKCU ms-settings shell open command) fails because the registry paths were compiled without backslashes; the Run key path has the same flaw. C2 runs through Tor (SocksPort 9050) to an operator onion service using ChaCha20 with a built-in pre-shared key. Capabilities: saved-password theft from Chrome, Edge and Brave via DPAPI (Chrome v20 App-Bound entries are not decrypted), Phantom and MetaMask wallet targeting, keylogging, clipboard reading, screenshots, screen streaming, webcam capture and idle-time Monero mining (RandomX over Tor). The binary contains the developer path C:/Users/MoH/socks.txt and uses folders named ollie under AppData\Roaming.

Campaign 2 (timdedid): three byte-identical Qwen3 1.7B copies aimed at security users (timdedid/qwen3.8-cyber-uncensored 271 downloads, timdedid/qwen3-cyber-UNCENSORED-2 136, timdedid/qwen3-cyber-UNCENSORED 75), published 21-22 November, plus an Ollama library mirror timdedid/qwen3-1.7b-cyber. When the latest user message contains 'What is', the template inserts a fake [SYSTEM DIRECTIVE] that orders an agent with a powershell tool to download value.ps1 from a WordPress site to C:\Windows\Temp\payload.ps1 and run it with -WindowStyle Hidden. The second stage was not recovered and its purpose is unknown. Malspark's YARA rule references technoarteng.com; the source does not state whether it is the script host.

Status: on 28 November 2026 (14:22 CET) the Hugging Face API marked all five repositories disabled for a content policy breach. One outlet reported the Ollama copy timdedid/qwen3-1.7b-cyber still listed with 42 downloads (single-source, untested). No file hashes, onion addresses, IPs or exact payload URLs were published; the file hash reportedly had no public sightings. Attribution is unknown. Malspark also documented lab-only hiding methods not seen in the wild: raised general.alignment padding, GGUF/ZIP polyglots and zero-scale Q8_0 block steganography. Severity HIGH is analyst-assigned; no CVE or CVSS exists.

## MITRE ATT&CK

- T1195.002 Compromise Software Supply Chain
- AML.T0010 AI Supply Chain Compromise
- T1204.002 Malicious File
- T1059.001 PowerShell
- T1053.005 Scheduled Task
- T1548.002 Bypass User Account Control
- T1027.009 Embedded Payloads
- T1140 Deobfuscate/Decode Files or Information
- T1497.001 System Checks
- T1564.003 Hidden Window
- T1555.003 Credentials from Web Browsers
- T1056.001 Keylogging
- T1113 Screen Capture
- T1125 Video Capture
- T1090.003 Multi-hop Proxy
- T1573.001 Symmetric Cryptography
- T1496.001 Compute Hijacking
- T1608.001 Stage Capabilities
- AML.T0051 LLM Prompt Injection
- T1547.001 Boot or Logon Autostart Execution
- T1112 Modify Registry
- T1115 Clipboard Data
- T1105 Ingress Tool Transfer

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**ollie RAT — PowerShell Carving Payload from GGUF Model (Poisoned Chat Template)** (`TL-2026-7168-SPL-001`)

Detects PowerShell reading bytes from a .gguf model file ([IO.File]::OpenRead / ReadAllBytes) and writing or inflating them (WriteAllBytes / IO.Compression.DeflateStream). This is the unpack-and-run line that the poisoned Mir2k GGUF chat templates make the model print, which carves the ollie RAT out of the bytes after the last tensor and writes it to %TEMP%\d.exe. Covers TL-2026-7168 (T1059.001, T1140, T1027.009, T1204.002). Runs against PowerShell 4104 script blocks and Sysmon process creation, so it also fires when the line is pasted into an interactive console.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1059.001, T1140, T1027.009, T1204.002
- **Data sources:** powershell_scriptblock_4104, sysmon_eventid_1
- **Severity:** high
- **Confidence:** high

### Splunk SPL

```spl
(index=windows sourcetype="XmlWinEventLog:Microsoft-Windows-PowerShell/Operational" EventCode=4104) OR (index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 (Image="*powershell.exe" OR Image="*pwsh.exe"))
| eval cmd=lower(coalesce(ScriptBlockText, CommandLine)), account=coalesce(user, UserID, "unknown")
| where like(cmd,"%.gguf%") AND (like(cmd,"%openread%") OR like(cmd,"%readallbytes%")) AND (like(cmd,"%writeallbytes%") OR like(cmd,"%deflatestream%"))
| eval threat_id="TL-2026-7168", malware="ollie"
| stats count earliest(_time) as first_seen latest(_time) as last_seen values(cmd) as command by host, account, threat_id, malware
| convert ctime(first_seen) ctime(last_seen)
```

### Microsoft KQL

```kql
let ps_block = DeviceEvents
| where Timestamp > ago(24h) and ActionType == 'PowerShellCommand'
| project Timestamp, DeviceName, AccountName, Cmd = tostring(parse_json(AdditionalFields).Command);
let ps_proc = DeviceProcessEvents
| where Timestamp > ago(24h) and FileName in~ ('powershell.exe', 'pwsh.exe')
| project Timestamp, DeviceName, AccountName, Cmd = ProcessCommandLine;
union ps_block, ps_proc
| where Cmd contains '.gguf'
| where Cmd contains 'OpenRead' or Cmd contains 'ReadAllBytes'
| where Cmd contains 'WriteAllBytes' or Cmd contains 'DeflateStream'
| summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), SampleCommand = take_any(Cmd) by DeviceName, AccountName
```

### Sigma

```yaml
title: ollie GGUF Payload Carving via PowerShell Script Block
id: 7c1f3e52-9a4b-4d0e-8b6a-2f5d9c3e1a71
status: experimental
description: Detects PowerShell script blocks that read bytes from a .gguf model file and write or inflate them, the unpack-and-run line printed by poisoned GGUF chat templates that drops the ollie RAT as d.exe. TL-2026-7168.
references:
  - https://malspark.com/blog/malicious-gguf-models-hugging-face/
author: Threadlinqs Team
date: 2026/12/01
tags:
  - attack.execution
  - attack.t1059.001
  - attack.t1204.002
  - attack.defense-evasion
  - attack.t1140
  - attack.t1027.009
logsource:
  product: windows
  category: ps_script
  definition: 'Requires PowerShell Script Block Logging (Event ID 4104)'
detection:
  selection_gguf:
    ScriptBlockText|contains: '.gguf'
  selection_read:
    ScriptBlockText|contains:
      - 'OpenRead'
      - 'ReadAllBytes'
  selection_write:
    ScriptBlockText|contains:
      - 'WriteAllBytes'
      - 'DeflateStream'
  condition: all of selection_*
falsepositives:
  - Legitimate scripts that parse or repackage GGUF model files
level: high

```

**Known false positives:**

- Developers or ML engineers scripting GGUF inspection or re-packaging in PowerShell
- Backup or file-copy scripts that read large .gguf files with .NET file APIs

**Tuning notes:** Adjust index names to your PowerShell and Sysmon indexes. Allow-list known ML tooling scripts by host or script path. The Inkling variant uses DeflateStream and the Huihui variant uses a plain byte copy, so keep both branches. Enable Script Block Logging (4104) fleet-wide, because the command is normally pasted into a console and may not appear in process command lines.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Malicious GGUF Model Acquisition — Mir2k / timdedid Repositories (Hugging Face and Ollama) (locked: unlock with TL Creds)
- ollie RAT — Host Artifacts: d.exe in Temp, AppData\Roaming\ollie Folder, rat.log and [indicator] (locked: unlock with TL Creds)
- ollie RAT — Embedded Tor Process Launch with SocksPort 9050 (locked: unlock with TL Creds)
- Agent Tool Hijack — Hidden PowerShell Downloading [indicator] to Windows\Temp\payload.ps1 (locked: unlock with TL Creds)
- ollie RAT — Browser Credential Store and Wallet Extension Access by Non-Browser Process (locked: unlock with TL Creds)
- Possible Second-Stage Host — DNS or Network Contact with [indicator] / [indicator] Download (locked: unlock with TL Creds)
- ollie RAT — Persistence via 10-Minute Highest-Privilege Task, StartupApproved and fodhelper UAC Hijack (locked: unlock with TL Creds)
- ollie RAT — Tor SocksPort 9050 Loopback Connections from User-Writable Process (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 41)

Defanged, TLP:CLEAR.

- Domain: `technoarteng[.]com`
- File hash: `90bbb476eadf0edb28f7042204cbf90065b1112f4152e4f335e85dd76788bf68`
- File hash: `da22856f95ee24f8ace4ad1ab04acbd818fd6c3042bc3cf8f1d7cc3fa3edcb2b`

Full set of 41 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims (Malspark)](https://malspark.com/blog/malicious-gguf-models-hugging-face/)
- [Hackers Turn Downloadable AI Models Into Malware Carriers Without Breaking Their Normal Functions (GBHackers)](https://gbhackers.com/ai-models-as-malware/)
- [gguf-radar (open-source GGUF scanner and sanitizer)](https://github.com/Root0ne/gguf-radar)
- [Hugging Face GGUF malware: models pulled, but the Ollama copy still serves it (i10x)](https://i10x.ai/news/hugging-face-gguf-malware-mir2k-timdedid-ollama-copy-still-live)
- [Poisoned GGUF template unpacks hidden RAT threat: detection, logs and IOCs (Spectrum Security)](https://www.spectrum.security/threats/poisoned-gguf-template-unpacks-hidden-rat)
- [Scan finds five malicious GGUF models on Hugging Face (Let's Data Science)](https://letsdatascience.com/news/scan-finds-five-malicious-gguf-models-on-hugging-face-d8fb12c9)
- [Poisoned Hugging Face GGUF models asked users to run hidden malware (Startup Fortune)](https://startupfortune.com/poisoned-hugging-face-gguf-models-asked-users-to-run-hidden-malware/)
- [Five Poisoned GGUF Models on Hugging Face Steered Users and Agents Toward Malware (Mallory)](https://mallory.ai/stories/01a22264-8815-7372-bd07-c25ad67a6f91)
- [GGUF Malware: 5 Models, 2,428 HF Downloads (explainx)](https://explainx.ai/blog/gguf-malware-hugging-face-chat-template-gguf-radar-november-2026)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7168
