← Sat, Nov 28 digest

GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims

read article ↗ hn thread ↗

A scan of 3.2 million Hugging Face repositories uncovered five malicious GGUF models using chat template poisoning and appended executables, accumulating over 2,400 downloads.

read it Detailed breakdown of how GGUF chat templates and trailing payload bytes are exploited, complete with a tool to detect and clean them.

summary

Local LLMs shared as GGUF files can carry malicious chat templates and hidden executables appended after the last tensor that runtimes ignore. A scan of over 3.2 million Hugging Face repositories found five models delivering a Windows RAT named ollie or hijacking tool calls. An open-source tool called gguf-radar detects these structures without executing code and rebuilds clean files.

key points

  1. GGUF format allows valid files to contain arbitrary data appended after the last tensor and executable logic inside Jinja2 chat templates.
  2. Two campaigns used these methods on Hugging Face to distribute a Windows RAT and hijack coding agent tool calls, reaching over 2,400 downloads.
  3. The open-source tool gguf-radar statically analyzes headers, templates, and trailing bytes to safely clean poisoned GGUF files while preserving tensor weights.

who should read it

Developers, machine learning engineers, and security practitioners working with local LLMs or model registries.

discussion mixed

consensus

Commenters find the attack vector clever but note the absolute number of infected models is surprisingly low, reinforcing that the main risk lies with untrusted sources and a lack of proper sandboxing.

pushback

Some argue that sandboxing agents and runtimes is the only true defense because malicious behavior can also be hidden directly inside model weights where static scans fail.

best comment by mrob ↗

IMO, any system that was exploited by this was already insecure. It's not exploiting bugs in the inference engine or attempting any kind of sandbox escape. Here the exploit was in the chat template, but it's possible to encode the same thing directly in the weights. Unless the model is truly Open Source (not just open weight), there's no way to know what malicious instructions might be encoded in the weights. The only defense is to sandbox the agent sufficiently strongly that it can't do harm no matter what tokens it generates. In such a sandbox, it doesn't matter that the payload was stored …

It argues that static file scanning is a band-aid and proper agent sandboxing is necessary since weights can harbor backdoors.

Generated by an LLM from the article and thread. Check the sources before relying on it.