Malware inside GGUF models: local hosting risks confront AI teams in the region
A comprehensive security scan of more than 3.27 million public model repositories on the Hugging Face platform revealed a technical breach that threatens the independent local computing strategies adopted by AI teams in the region, after five models were found infected with malware that logged 2,428 downloads by the end of November 2026. The report details how the attackers exploited the common GGUF file format, embedding full spyware programs inside the weight files themselves without affecting the model’s operation or triggering standard engine warnings.
The attack relies on two integrated technical exploits; the first is the tokenization of conversation templates, tokenizer.chat_template, written in Jinja2, which the runtime engine automatically applies to every input. Although engines such as llama.cpp execute templates in an isolated environment that prevents command injection into the operating system, the attackers used the template to add hidden directives that do not appear to the user in the chat window, instructing the model to begin its response with a command line that asks the user to run it, or sending direct instructions to programming agents that have terminal access.
The executable hides in the dead space after the last computational matrix within the model file, away from the eyes of the runtime engines.The second exploit takes advantage of the GGUF structure, which relies on a header that precisely defines the weight data range; runtime engines such as LM Studio read the specified bytes and ignore any additional data appended to the end of the file. Unlike the Safetensors format, which rejects any file whose size does not match the declared matrix size, the GGUF format allowed the Mir2k campaign to append a custom spyware program for Windows, named ollie, 11.47 MB in size, containing a full Tor network and targeting password theft, digital wallet theft, and cryptocurrency mining.
The attacks were not limited to a single campaign; analysis revealed another campaign launched by accounts named timdedid, which modified developer-targeted model templates to replace a specific phrase in the user message such as “What is,” then injected a system directive that commands the programming agent to run a PowerShell command to silently download malicious text software into the system path. Laboratory tests proved that data could also be hidden by increasing internal alignment gaps, embedding callable compressed archive files via Python, or manipulating zero-coefficient quantization weights.
Header inspection and byte-range matching before loading has become the primary line of defense in sensitive work environments.In response to this novel threat pattern, the open-source tool gguf-radar provides a static scanning mechanism that detects obfuscated templates and attached data without executing files, with the ability to clean and rebuild them while preserving the original weight precision.
What does this mean for the region
Wide sectors of banking institutions, government agencies, and startups in Saudi Arabia, the United Arab Emirates, and Egypt rely on local model deployment to meet digital sovereignty requirements and protect data from public extraction. This discovery undermines the prevailing assumption that downloading open model weights is inherently safe, and it requires information security officers to subject model files to the same stringent audit standards applied to binary software and external libraries.
At the development and operations level, it has become necessary to restrict the privileges of programming agents and smart code assistants; granting agents direct terminal access without strict isolation turns any local model into an entry point for intruding into internal networks with a seemingly ordinary query. This shift also mandates the integration of structural inspection tools such as gguf-radar into automated deployment pipelines before allowing any weights from open repositories to be transferred to local production servers.