Malware hidden inside AI model files on Hugging Face hit 2,400 downloads

A scan of every public Hugging Face repository found five GGUF model files carrying hidden malware or poisoned chat templates, with downloads climbing past 2,400 as of 27 November.

AIVIO News Desk 2 min read
AIVIO News cover illustration for: Malware hidden inside AI model files on Hugging Face hit 2,400 downloads

Five AI model files uploaded to Hugging Face were found to carry hidden malware or booby-trapped instructions, and had drawn more than 2,400 downloads as of 27 November, according to a scan published by the security research blog malspark. The files use the GGUF format, a common packaging method for running open-source language models on a personal computer.

Malspark says the files exploit two weaknesses specific to GGUF. The first is the chat template, a small program bundled with every model that formats text before the model reads it; attackers can edit that template to insert hidden instructions the user never sees in the chat window. The second is unused space at the end of the file, past the last block of model weights, where ordinary software never looks and where an entire executable program can be tucked away.

The larger of the two campaigns, run by an account called Mir2k, uploaded two uncensored models on 22 and 24 November with a hidden Windows program already embedded, malspark reports. The account also created twelve empty, pre-named placeholder repositories, apparently reserved for AI models not yet released. On the morning of 26 November, and again roughly nine hours later, Mir2k rewrote both chat templates so that the model would tell a user to copy and run a command that unpacks the hidden program, which malspark calls ollie.

According to malspark’s analysis, ollie checks for virtual-machine software before running, then sets up a scheduled task and a protected process to survive restarts. It installs the anonymity network Tor to reach its operator, pulls saved browser passwords out of Chrome, Edge and Brave, and looks for the Phantom and MetaMask cryptocurrency wallet extensions. It can also log keystrokes, read the clipboard, take screenshots, stream the screen and mine the cryptocurrency Monero when the computer is idle. Malspark notes that one attempted Windows privilege-escalation technique in the code was written with a formatting error and does not work.

A separate campaign from an account called timdedid uploaded three models a day earlier, on 21 and 22 November, using a different method: a trigger phrase in a user’s message causes the template to insert a fake system command ordering an AI agent with shell access to download and run a further script. Malspark says it could not recover that second-stage script.

What this means

The two campaigns show that a GGUF file can carry a functioning weapon without changing how the model answers or loads, so neither behavior nor file size reliably exposes it. Malspark’s figures count downloads, not individual victims, so the true number of affected machines is uncertain and could be lower. The report does not say whether Hugging Face has removed the files, and all five were still online as of 27 November.

Malspark points practitioners toward its own scanning tool, gguf-radar, which checks a model’s chat template and file structure without running either, and can produce a cleaned copy of the file. Downloads of the two Mir2k models grew by more than half in a single day, a pace malspark’s report leaves unexplained.

Sources

malspark.com