Malspark examined five public Hugging Face repositories whose GGUF model files carried malicious chat templates. A chat template formats the conversation before the model reads it. It can add instructions that never appear in the chat window.

In two repositories, Malspark recovered a Windows remote-control program bundled with the weights. The altered templates tried to make the model show a command for a person to run. In the other three, templates tried to get an agent with shell access to fetch and run a script. Malspark did not recover that script. The report shows malicious files were distributed, not that ordinary GGUF loading executed them or that any particular machine was infected.

Christopher Ort at i10X reported that Hugging Face had disabled all five repositories on November 28. He found a copy of one model on Ollama’s public library with the same hidden instruction. His report did not establish whether Ollama used that embedded template. A takedown does not remove copies already cached or mirrored.

Review the template before giving a model tools

  • Pin what you reviewed. Use a known publisher and pin the exact model revision. Review its chat template separately. Where the runtime supports it, configure a reviewed template explicitly. A template override does not remove any unexpected data from the model file itself.
  • Restrict what the model can run. Start unfamiliar models without shell access, credentials or writable host mounts. Keep tool permissions outside the prompt, and reject unexpected commands even when they arrive inside an otherwise useful reply.
  • Quarantine a suspect copy. Stop using it and check cached copies and mirrors. If a person or an agent ran a suggested command, isolate the machine and check endpoint logs. Replace potentially exposed credentials from a clean device.

Malspark publishes its own GGUF scanner alongside the report. Its lab results are useful for spotting suspicious files, but a clean scan is not proof that a model is safe to give tools.

What the thread adds

In the Hacker News discussion, stephantul raised the difference between downloads and users. A reply from fuussssip asked how literal file downloads fit in. Hugging Face’s documentation says its counters include requests for counted files. Cloning a repository can count multiple GGUF files. The 2,428 recorded on November 27 were download counts, not unique people or victims.

When a reader brought up Safetensors, kccqzy replied: “I really appreciate the effort behind safetensors, but I think in this case it wouldn’t help.” Safetensors stores model weights. The Transformers documentation shows that the library loads chat templates separately. Review the template even when the weights come in Safetensors format.