AI ShortsOpen the app
Tools & Dev ยท

Malware hides inside popular AI model files

Five malicious model files turned up when a researcher scanned about 3.27 million public models on Hugging Face. They were downloaded 2,428 times. The trick hides instructions inside the model's chat template, so users never see them.

GGUF is a popular file format for running AI models on your own computer. A new write-up from MalSpark scanned about 3.27 million public model pages on Hugging Face, a big site for sharing models, and found five malicious GGUF models. Together they had been downloaded 2,428 times as of 27 November.

The attack uses the "chat template," a small piece of text inside the model file that shapes every conversation. In these cases it secretly added instructions the user never saw.

In one campaign, two "uncensored" models hid a Windows remote access trojan inside the file. The template then told users to paste a PowerShell line, which unpacked and ran it. In a second campaign, three models used a hidden "system directive" that fired on a trigger phrase and told AI agents with shell access to download and run a script.

The author says common antivirus and pickle scanners missed these files, and showed three other ways to hide data in GGUF files in a lab setting. Anyone downloading models from public sites can't rely on those scanners alone.

New to this? The key idea

A GGUF file is like a shipping box for an AI model, and it carries a small instruction sheet called the chat template that tells the program how to format every conversation. Most people only think about the model's weights, but that instruction sheet is text that can be edited by an attacker. Treat it like a macro in an office document: it looks harmless but can steer what you do next.

Use it at work

Use it for: checking GGUF models before they reach developer laptops or an internal model registry. Security engineers and whoever runs the platform or ML tooling team should care.

Try it: the article shows these gguf-radar commands, and says the repository is github.com/Root0ne/gguf-radar (no install command is shown, so follow the repo).

gguf-radar scan ./model.gguf
gguf-radar sanitize suspicious.gguf -o clean.gguf
gguf-radar scan https://huggingface.co/owner/model

Scan a model you already use, then sanitize any file it flags. Treat any command a model suggests as untrusted, and replace embedded chat templates with reviewed ones. Model hubs and runtimes should reject GGUF files with trailing bytes or non-zero padding.

Before you roll it out: gguf-radar is open source under the MIT licence, and the post publishes YARA rules and indicators of compromise. It inspects templates and file structure without running the model, then rebuilds a clean file with the weights unchanged. Scanning public Hugging Face models needs no API key and reads only the file header and end, so weights are not downloaded; a token is needed only for private or gated repos. The post does not say how complete detection is, so do not treat it as a guarantee. The zero-scale block check only runs on local scans. Cost beyond the free tool: not stated.

Summaries are written by AI from the linked source. Always check the original.

Get AI Shorts by email

Every morning, the day's stories in one short email. Unsubscribe in one tap.