Guide · AI security · as of 29 November 2026

Five poisoned AI models on Hugging Face told agents to run malware. Five checks.

On 27 November the security firm Malspark published a scan of every public model on Hugging Face, 3.27 million repositories, the place most people download AI models to run on their own computers. It found five models that look normal and answer normally, but carry hidden instructions. Two make the model print a command that unpacks a Windows spying program hidden inside the model file. Three tell an AI agent with access to a command line to download a script and run it. Together the five had been downloaded 2,428 times by 27 November. That counts downloads, not people, and a download alone does not infect anything. On 29 November all five were still online. This guide explains how the trick works, what our check of our own local models found, and five checks for any business that runs AI models in-house.

Private AI in the UAE: running models on your own servers

How the trick works

The hidden part is the template.

Models for local use are usually shared as GGUF files, the format read by tools such as Ollama, LM Studio and llama.cpp. Every GGUF file carries a chat template: a small program that turns your conversation into the exact text the model reads, before every reply. You never see it. Anything it adds to the conversation does not appear in the chat window. The attackers did not need to break the program out of its box. They used ordinary template logic to add their own lines. In one set of models, a message containing the words “What is” makes the template slip in a fake system order telling the agent to call its PowerShell tool, fetch a script from a website and run it in a hidden window. The model card even advises users not to replace the built-in template. Malspark also found that GGUF lets an attacker add a whole program after the end of the model data, where the loading software never looks.

Plant first, switch on later

Clean on Monday, armed by Thursday.

The larger campaign, under the account name Mir2k, uploaded two “uncensored” models on 22 and 24 November with the spying program already hidden at the end of each file and a clean template. On 26 November it rewrote both templates so that every answer begins with one PowerShell line, which finds the model file on the computer, reads the hidden bytes out of it and starts them. The same account had created twelve empty repositories named after models people are waiting for, ready to be filled on release day. The program, called ollie, is for Windows. Malspark lists what it does: it reads saved passwords from Chrome, Edge and Brave, goes after two crypto wallet extensions, logs keystrokes, takes screenshots and webcam images, and mines cryptocurrency when the machine is idle, all through the Tor network. Its folder is named ollie, close enough to Ollama to look familiar. In both campaigns the model never runs anything by itself: a person has to copy the command, or an agent has to be allowed to run it.

What our own check found

Four models, four plain templates.

On 29 November we checked the AI models on our own development workstation. Four models run in Ollama, and all four came from Ollama’s own library, not from an individual uploader. We printed the template each one actually runs with and searched it for web addresses, PowerShell, download commands, the words “system directive” and similar patterns. None of the four matched. Before trusting that result we ran the same search on a test line written like the attackers’ one, and it caught it. Our other local models come from known publishers such as OpenAI and Hugging Face itself, and none is a GGUF chat model. Two of our scripts call the local models, one to list them and one to have a vision model judge images, and neither gives a model a command line. One thing we could not check: whether extra bytes sit after the model data in Ollama’s own files, because those files belong to the Ollama service and our user account cannot read them. That part of the check is still open.

Your AI server trusts localhost: four checks

Five checks for models you run in-house

Run these this week.

  • 1. List every local model and where it came from. Test: run `ollama list`, and look in the model folder of LM Studio or any other tool you use. Anything from an unknown uploader goes first, especially names with “uncensored” or “abliterated”, or a model that has not officially been released yet.
  • 2. Read the template each model runs with. Test: in Ollama, `ollama show --template <model>`. Look for web addresses, PowerShell, curl or wget, download commands, “system directive”, or lines that only switch on when your message contains certain words.
  • 3. Pin a template you have reviewed for any model that can use tools. Test: in Ollama, write a TEMPLATE line in a Modelfile; in llama.cpp, pass `--chat-template-file`. The file’s own template is then out of the loop.
  • 4. Take the command line away from local agents that run community models, or make every command wait for a person to approve it. Test: ask your agent setup which tools the model can call. If a shell is on the list with no approval step, that is the door these models were built for.
  • 5. Scan model files before they reach a laptop, and treat any command a model suggests as untrusted. Test: run the free open-source scanner gguf-radar on one model file you already have, and make it a step before any new model is shared inside the company.

Questions

Questions about poisoned AI models.

  • Are Hugging Face models safe to download?

    Most are, but not all. Malspark scanned all 3.27 million public model repositories on 26 November 2026 and found five malicious GGUF models with 2,428 downloads, still online on 29 November. Prefer models from known publishers, read the template before use, and do not let a downloaded model run commands.

  • What is a GGUF chat template?

    A small Jinja2 program stored inside a GGUF model file that turns your conversation into the exact text the model reads before each reply. You do not see it, so text it adds stays hidden from the chat window.

  • Can a GGUF model run malware on its own?

    Not in the cases found. The poisoned templates make the model print a command or tell an AI agent to run one. Harm happens when a person copies the command or an agent with a command-line tool runs it.

  • Is Ollama safe to run locally?

    Ollama itself was not the problem in this report. The risk is the model you load into it. Models from Ollama’s own library come with Ollama’s templates; for any other model, read its template with ollama show --template and pin a reviewed one with a TEMPLATE line in a Modelfile.

  • Which models were malicious?

    Malspark named two Mir2k models (Huihui-Qwen3.5-9B-abliterated-GGUF and Inkling-2-Mini-Uncensored-GGUF) and three timdedid models (qwen3.8-cyber-uncensored, qwen3-cyber-UNCENSORED-2 and qwen3-cyber-UNCENSORED), plus an Ollama mirror named timdedid/qwen3-1.7b-cyber.

  • How do I check a model file for hidden malware?

    Malspark released gguf-radar, a free open-source tool under the MIT licence, which reads the template and the end of the file without running anything and can rebuild a clean file with the same weights. Ordinary antivirus did not flag the files in its tests.

  • Does this matter for a UAE business?

    Yes, for any business that runs AI models on its own computers or servers, which is often done precisely to keep data in the UAE. The checks cost an afternoon, and they belong in the same list as patching and passwords.

Sources

read 29 November 2026

Check it at the source.

  1. Malspark: GGUF LLM models with hidden malware on Hugging Face (27 November 2026: the scan, both campaigns, the ollie program and the recommendations)
  2. gguf-radar on GitHub (the free scanner from the same research, MIT licence)
  3. Ollama: Modelfile reference (how a TEMPLATE line replaces the template a model runs with)
  4. BRev Digital: your AI server trusts localhost (the other half of running AI in-house: the server itself)
  5. BRev Digital: when two AI tools share a name (another way an agent is steered by text it cannot verify)

A question?

Running AI models in-house?

Tell us which models and tools you use, even roughly. We will go through the five checks with you and say plainly what to change first.

Talk to usWhatsApp +971 50 728 5494hello@brevdigital.com