By Hamza Faisal

Security researchers have exposed a cryptomining and backdoor campaign that hid inside fake AI models on Hugging Face, the popular model-sharing hub. Pluto Security's Load/Mine report, published on October 29, traces 31 malicious repositories across seven Hugging Face accounts, plus a mirror on ModelScope, that recorded more than 32,000 downloads once linked repositories are counted. The firm stresses that the figure measures downloads, not confirmed infections or unique victims.

The fake models imitated Qwen2, a well-known family of small language models, with plain names such as qwen2-tiny and qwen2-mini. One repository copied the description of the official Qwen2.5-0.5B model word for word. In the most downloaded case, the file supposed to hold the model's data was a 42-byte stand-in containing no tensors at all. The attack did not need malicious weights, because the code did the damage before any model loaded.

The code runs before the model does

The campaign exploited a documented feature of Hugging Face's Transformers library. Loading a model with remote code enabled imports the repository's Python code with the caller's privileges before the weights load, and an entry in the repository's configuration names the Python module to run. In these repositories, that code fetched a mining tool and set the victim's graphics card mining cryptocurrency for the attacker.

That behaviour is documented, not a default, and the Transformers security policy tells users to verify modeling files when using the option. The report also cites a related flaw, CVE-2026-22807, in which versions of the vLLM inference server from 0.10.1 up to the fix in 0.14.0 loaded such modules without checking the remote-code setting, allowing a malicious repository to run code at server startup.

Scanners checked the weights, not the code

What makes the campaign notable is how cleanly it passed the platform's defences. Hugging Face checks every file under 2 GB with its antivirus scanner, and partner scanners inspect supported model formats — but none analysed what the Python loader files actually did. In Pluto's tests, the flagship payload came back safe from every scanner, one reporting it was not a machine-learning model. None of the 12 first-wave repositories were flagged.

The payloads targeted self-hosted AI infrastructure: GPU hosts running inference tools such as Xinference and GPUStack, rented GPU machines, shared research notebooks, and continuous-integration jobs that pull small test models without anyone reading the code. Such machines often hold credentials and data worth far more than the compute, and the planted backdoor access does not expire when the miner stops.

Takedown did not end it

Hugging Face and ModelScope removed the first wave's accounts and mirror after Pluto reported them — but a second wave appeared within days under new accounts, using reverse shells and revised loaders. The 19 second-wave repositories recorded more than 29,000 downloads and were still live eight days after Pluto reported them. Over three weeks the payload grew from a 37-line SSH backdoor into a 305-line fileless miner running from memory, disguised as a kernel worker, removing rival miners and keeping access via shell hooks and a watchdog.

Pluto traced the first wave's mining proceeds to a wallet that had received about 2,276 PRL, roughly $5,000, and assessed the operator as a financially motivated, Chinese-speaking actor or small group active since September 2026. Its advice: inspect any Python files a model's configuration references before enabling remote code, pin reviewed revisions, and run untrusted models with limited privileges. Teams that loaded the affected models should check for the miner and persistence files, then rotate tokens, passwords, cloud credentials and SSH keys from a clean machine.