Malicious GGUF Models on Hugging Face Deliver Windows RAT

Malicious AI Models on Hugging Face Hide Windows RAT in GGUF Files

HIGH
November 29, 2026
6m read
MalwareSupply Chain AttackThreat Intelligence

Impact Scope

People Affected

2,428 downloads

Industries Affected

Technology

Related Entities

Threat Actors

Mir2ktimdedid

Products & Tech

gguf-radarllama.cpp

Other

Full Report

Executive Summary

A novel malware distribution campaign has been uncovered on the Hugging Face AI model repository, a popular platform for sharing and downloading machine learning models. Researchers found at least five malicious Large Language Models (LLMs) in the GGUF format that contained a hidden Windows Remote Access Trojan (RAT), nicknamed "ollie." The models were downloaded a combined 2,428 times before being taken down. The attack used a clever two-stage mechanism where the malware was first hidden inside the model file and then activated days later by modifying the model's chat template to include a malicious PowerShell command, which the user would have to copy and execute manually.

Threat Overview

The primary campaign was orchestrated by a Hugging Face user account named 'Mir2k.' The threat actor used a two-part attack:

  1. Stage 1 (Payload Hiding): The attacker uploaded several GGUF-formatted AI models. At the end of these files, after the legitimate model data, they appended a Windows RAT payload. Because LLM applications like llama.cpp only read the required model weights, the extra data at the end of the file is ignored, and the model functions normally, making the payload dormant and difficult to detect.
  2. Stage 2 (Activation): Days later, on November 26, the attacker modified the chat_template for these models. The template was altered to prepend a one-line PowerShell command to every response generated by the LLM. If a user copied the full response, including the malicious command, and pasted it into a PowerShell terminal, the command would execute. This command was designed to find the model file on the user's disk, extract the hidden 'ollie' RAT, and run it.

A smaller, secondary campaign by a user named 'timdedid' used a similar template-poisoning technique to trick AI coding agents into executing malicious scripts. Hugging Face has since disabled all five malicious repositories.

Technical Analysis

This attack represents an emerging threat vector targeting the growing community of AI developers and hobbyists running models locally.

The attack relies on social engineering, as the user must manually copy and execute the PowerShell command. However, in the context of interacting with LLMs, users frequently copy and paste code snippets, making this a plausible infection vector.

Impact Assessment

Users who downloaded and ran these malicious models are at risk of significant data theft and system compromise. The impact includes:

  • Credential Theft: Loss of saved browser passwords, which can lead to the compromise of various online accounts.
  • Financial Loss: Theft of cryptocurrency wallet files can result in direct financial loss.
  • System Performance Degradation: The use of system resources for crypto mining can slow down the computer and increase electricity costs.
  • Erosion of Trust: This incident damages trust in public AI model repositories and highlights the need for better security vetting of user-contributed content.

In response to the findings, the security researchers have released an open-source tool called gguf-radar to help users scan GGUF model files for hidden executable content.

IOCs — Directly from Articles

No specific file hashes or C2 domains were mentioned in the source articles. The primary indicators are the threat actor account names.

Type
user_agent
Value
Mir2k
Description
Hugging Face account name of the primary threat actor.
Type
user_agent
Value
timdedid
Description
Hugging Face account name of the secondary threat actor.

Cyber Observables — Hunting Hints

Users of local LLMs can look for the following signs:

Type
command_line_pattern
Value / Pattern
powershell -Command ...
Description
Unexpected PowerShell commands appearing in the output of an LLM.
Context
LLM application interface
Type
process_name
Value / Pattern
powershell.exe
Description
Look for powershell.exe processes spawning from your LLM application or terminal.
Context
EDR, Process monitoring
Type
network_traffic_pattern
Value / Pattern
Unexpected outbound connections from processes running on the local machine.
Description
The RAT will attempt to connect to a C2 server.
Context
Personal firewall logs, NetFlow
Type
other
Value / Pattern
gguf-radar tool
Description
Use the open-source gguf-radar tool to scan downloaded .gguf files for suspicious appended data.
Context
File system analysis

Detection & Response

Detection:

  • Output Sanitization: Be extremely cautious about copying and executing code or commands generated by LLMs, especially from untrusted models. Manually inspect any generated commands before running them.
  • File Scanning: Use tools like gguf-radar to scan all downloaded models before use.
  • Process Monitoring: Monitor for suspicious PowerShell execution, especially commands that read from large model files and write to executables.

Response:

  1. If an infection is suspected, disconnect the machine from the network to prevent C2 communication.
  2. Delete the malicious model files and any executables created by the PowerShell script.
  3. Run a full antivirus scan.
  4. Change all saved browser passwords and move funds from any local cryptocurrency wallets.

Mitigation

  • M1017 - User Training: The most critical mitigation is user awareness. Users should be trained to treat AI-generated code with the same suspicion as code from any untrusted internet source.
  • Vetting AI Models: Only use models from trusted, verified publishers on platforms like Hugging Face. Scrutinize models with few downloads or from new, unknown accounts.
  • M1038 - Execution Prevention: Configure PowerShell execution policies to be more restrictive, preventing the running of unsigned or untrusted scripts.
  • M1049 - Antivirus/Antimalware: Keep security software up to date to detect the RAT payload if it is successfully extracted and executed.

Timeline of Events

1
November 26, 2026
Threat actor 'Mir2k' modifies the chat templates of previously uploaded models to include a malicious PowerShell command.
2
November 27, 2026
Security researchers publish their findings on the malicious GGUF models.
3
November 28, 2026
Hugging Face disables the five malicious model repositories.
4
November 29, 2026
This article was published

MITRE ATT&CK Mitigations

Educate users to be skeptical of code generated by AI models and to never execute commands from untrusted sources without careful inspection.

Use restrictive PowerShell execution policies and application control to prevent untrusted scripts from running.

Deploy endpoint security solutions that can detect and block known RATs and crypto-mining malware.

Timeline of Events

1
November 26, 2026

Threat actor 'Mir2k' modifies the chat templates of previously uploaded models to include a malicious PowerShell command.

2
November 27, 2026

Security researchers publish their findings on the malicious GGUF models.

3
November 28, 2026

Hugging Face disables the five malicious model repositories.

Sources & References

Malicious GGUF Models on Hugging Face Hide Windows Trojan
MalSpark (malspark.com) •November 27, 2026
GGUF LLM models with hidden malware on Hugging Face
Reddit (reddit.com) •November 27, 2026
Hugging Face Platform Found to Host Malicious GGUF Models with Windows Malware
ShiftDelete.Net (shiftdelete.net) •November 28, 2026
Hugging Face GGUF Models Distribute Windows Trojan
Gridinsoft (blog.gridinsoft.com) •November 28, 2026
Malicious AI Models on Hugging Face!
YouTube (youtube.com) •November 28, 2026

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Editorial Standards & Analyst Review

CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.

Tags

hugging facemalwareaillmggufratpowershellsupply chain

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

⚡ Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.