On the popular Hugging Face platform, where developers publish open-source artificial intelligence models, five malicious repositories have been discovered containing AI models with embedded Windows viruses or hidden instructions to execute malicious code via AI agents. Cybersecurity specialist Düzgün, who analyzed 3.27 million public repositories on the platform, reported the findings. According to his data, the infected models were downloaded 2,428 times. A key feature of the attack is that the malware can reside directly inside the neural network file itself, while the model during normal communication appears fully functional and shows no signs of compromise.

How the Trojan Hides Inside the Model File

In the most thoroughly studied campaign, the attackers used the GGUF format, which is widely used for running language models locally. Researchers discovered that the attackers appended a Windows executable file to the end of the model file — past the area containing the neural network weights. Model-loading software does not read this part, so the malicious code does not interfere with the loading and operation of the AI model. Additionally, the attackers altered the chat template — the instruction defining how prompts are formatted for the model — by adding a hidden directive to start every response with a PowerShell command. The user sees a normal neural network response, but at the beginning of it is a command that extracts the Trojan from the model file and executes it. However, the chat interaction itself does not cause infection; users must manually execute the command suggested by the model to become infected.

Capabilities of the Ollie Trojan

The discovered Trojan has been named ollie. Once executed, it is capable of establishing persistence in the Windows system, stealing saved passwords from Chrome, Edge, and Brave browsers, accessing Phantom and MetaMask crypto wallet extensions, capturing keystrokes, reading clipboard contents, taking screenshots, and capturing webcam footage. To communicate with the command-and-control server, the malware uses the Tor network, and during periods of computer inactivity, it runs a Monero cryptocurrency miner. Thus, the Trojan combines espionage, financial data theft, and the utilization of the victim's computing resources.

Second Campaign and Hidden Instructions for AI Agents

In addition to the main campaign, the researcher discovered a second one: in three other repositories, hidden instructions attempted to force AI agents with terminal access to independently download and execute a malicious script. The contents of this script could not be determined, leaving open the question of its full set of features. Nevertheless, the mechanism itself — inducing an autonomous AI agent to download and execute malicious code — represents a distinct class of threats associated with the proliferation of agentic systems granted command-line privileges.

GGUF Radar Tool for Model Verification

To check for such threats, the developer released GGUF Radar, an open-source tool that analyzes model files and their chat templates without running the neural network. It checks for hidden executable data and suspicious instructions, and can also create a cleaned copy of the GGUF file while preserving the original model weights. The tool works not only with local files but also with Hugging Face repositories, allowing users and platform administrators to inspect models before deploying them into working environments.