Un troyano escondido al final de dos modelos de IA: 2.428 descargas en Hugging Face y una plantilla que pide ejecutar PowerShell
Un escaneo de los 3,27 millones de repositorios públicos de Hugging Face encontró cinco modelos GGUF maliciosos, dos de ellos con un programa de Windows pegado después del último tensor. Días después, la plantilla de chat se cambió para que el propio modelo dictara el comando que lo despierta.
A scan of all 3.27 million public Hugging Face repositories found five malicious GGUF models, two of them carrying a Windows program appended after the last tensor. Days later the chat template was rewritten so the model itself prints the command that wakes it up.
El archivo se comporta bien
Un modelo GGUF tiene una estructura simple: una cabecera, una tabla de metadatos, la tabla de tensores y, al final, los pesos. Los motores que lo cargan, como llama.cpp o LM Studio, leen exactamente los rangos de bytes que indica la cabecera e ignoran el resto. Ese resto es el hueco.
Un escaneo de los 3.273.389 repositorios públicos de modelos de Hugging Face, publicado esta semana, encontró cinco modelos GGUF maliciosos con 2.428 descargas contabilizadas. Dos de ellos, de la cuenta Mir2k, llevaban un ejecutable de Windows pegado detrás del último tensor.
Dos campañas, cinco repositorios
El análisis revisó 226.310 repositorios en formato GGUF, 2,56 petabytes de pesos, y 572.184 plantillas de chat de forma estática, sin ejecutar ninguna. La campaña principal, Mir2k, subió dos modelos sin censura —uno derivado de Qwen3.5 de 9B y otro de Inkling 2 Mini— y sumó 1.488 y 458 descargas.
El orden de los hechos importa. La cuenta se creó el 22 de noviembre con 14 repositorios: doce vacíos, con nombres de modelos que todavía no existen. El primer modelo llegó ese día con el ejecutable ya pegado al final pero con su plantilla original, limpia. El 26 por la mañana, en menos de una hora, se reemplazaron las dos plantillas. Nueve horas después, otra versión buscaba el archivo por todo el perfil del usuario. Quien descargó el modelo antes del 26 tiene el programa escondido pero no el gatillo.
La plantilla es el vector
Cada GGUF lleva una plantilla de chat en Jinja2 que el motor aplica antes de cada respuesta. Los motores en C++ la interpretan en un entorno restringido, así que los ataques clásicos de inyección no llegan al sistema. No hace falta: basta con añadir texto que el usuario no ve. En la otra campaña, timdedid, una frase en el mensaje del usuario hace que la plantilla inserte una falsa directiva de sistema que ordena a un agente con acceso a la consola descargar y ejecutar un script.
«Todo lo que va después de ese punto no se lee nunca, así que no cambia cómo carga el modelo ni cómo se comporta, y ningún motor avisa», escribe Malspark sobre los bytes pegados al final del archivo.
Qué hace si se ejecuta
El RAT, bautizado ollie, se copia fuera del modelo, roba datos, mina criptomoneda con RandomX y monta un cliente Tor.
Los modelos Safetensors no admiten este truco, porque su cargador rechaza un archivo cuyos tensores no lo llenan exactamente. La recomendación es revisar la plantilla antes de usar un modelo descargado, desconfiar de las cuentas nuevas que ofrecen versiones «sin censura» y, para quien ya lo bajó, usar gguf-radar, que detecta estas plantillas y reconstruye el archivo sin tocar los pesos.
Fuentes: análisis de Malspark, gguf-radar, Pillar Security sobre plantillas GGUF.
The file behaves normally
A GGUF model has a simple layout: a header, a metadata table, a tensor table and, at the end, the weights. The engines that load it, such as llama.cpp or LM Studio, read exactly the byte ranges the header points to and ignore everything else. That everything else is the gap.
A scan of all 3,273,389 public model repositories on Hugging Face, published this week, found five malicious GGUF models with 2,428 counted downloads. Two of them, from the Mir2k account, carried a Windows executable appended after the last tensor. The malicious program travels inside the model file and the engine never reads it.
Two campaigns, five repositories
The analysis covered 226,310 repositories in GGUF format, 2.56 petabytes of weights, and parsed 572,184 chat templates statically, without running any of them. The main campaign, Mir2k, uploaded two uncensored models —one derived from Qwen3.5 9B and one from Inkling 2 Mini— which drew 1,488 and 458 downloads.
The order of events matters. The account was created on 22 November with 14 repositories: twelve empty, named after models that do not exist yet (Qwen4-27B, DeepSeek-V4, Llama-4-Scout, gemma-4-27b). The first model arrived that day with the executable already appended but with its original, clean template. On the morning of 26 November, within about an hour, both templates were replaced. Nine hours later another version searched the whole user profile for the file. Anyone who downloaded the model before the 26th has the hidden program but not the trigger.
The template is the vector
Every GGUF carries a Jinja2 chat template that the runtime applies before each answer. C++ engines render it in a restricted environment, so classic injection payloads never reach the system. They do not need to: adding text the user cannot see is enough. In the other campaign, timdedid, a phrase in the user's message makes the template insert a fake system directive ordering an agent with shell access to download and run a script.
«Anything after that point is never read, so it does not change how the model loads or behaves, and no runtime warns about it», Malspark writes about the bytes appended at the end of the file.
What happens if it runs
The RAT, named ollie, copies itself out of the model, steals data, mines cryptocurrency with RandomX and sets up a Tor client. The strings and messages in the Mir2k account are in French; the other campaign contains Chinese comments.
Safetensors models do not allow this trick, because their loader rejects a file whose declared tensors do not fill it exactly. The advice is to review the template before using a downloaded model, distrust new accounts offering «uncensored» builds and, for anyone who already downloaded one, run gguf-radar, which detects these templates and rebuilds the file without touching the weights.
Fuentes: Malspark analysis, gguf-radar, Pillar Security on GGUF templates.
Sigue leyendo
Keep reading
College Board confirma la brecha: entraron a las cuentas nuevas y a las solicitudes de ayuda financiera
La organización del SAT y los exámenes AP dice que los atacantes usaron herramientas de IA para encontrar un fallo en la página de registro. Desactivó el registro de cuentas y el CSS Profile en plena temporada de solicitudes de ingreso.
College Board confirms the breach: attackers got into new accounts and financial aid applications
The organisation behind the SAT and AP exams says attackers used AI tools to find a flaw on the sign-up page. It switched off new account registration and the CSS Profile in the middle of college application season.
Los instaladores oficiales de Q-Dir y DesktopOK traían un RAT de Python: abrían el programa de verdad y espiaban por detrás
AhnLab confirmó que algunos instaladores servidos por la web oficial de SoftwareOK, incluidos los de la ruta de actualización, estaban manipulados. Ejecutan la utilidad legítima, firmada y con el hash publicado, mientras descargan un troyano que lleva su propio intérprete de Python.
Official Q-Dir and DesktopOK installers carried a Python RAT: they opened the real program and spied behind it
AhnLab confirmed that some installers served by SoftwareOK's official site, including those on the update path, had been tampered with. They run the legitimate, signed utility matching the published hash while downloading a trojan that ships its own Python runtime.
Un «vishing» a Boston Scientific expone datos médicos y números de Seguro Social de 117.789 personas
Los atacantes convencieron por teléfono a empleados y entraron en la nube de la empresa de dispositivos médicos, donde había información desde el 7 de mayo. El aviso llega tres meses después de otro incidente que paralizó pedidos y envíos en todo el mundo.
A vishing call to Boston Scientific exposes medical data and Social Security numbers of 117,789 people
Attackers talked employees through a phone call and got into the medical device maker's cloud, where information had been sitting since 7 May. The notice arrives three months after another incident that disrupted orders and shipping worldwide.


