Hugging Face abused by malicious models; 31 repositories distribute miners and backdoors
Hugging Face遭惡意模型濫用,31個儲存庫散布挖礦程式與後門
Security firm Pluto Security disclosed a malware campaign named Load/Mine, in which attackers used Hugging Face to distribute malicious programs disguised as Qwen2 test models. Researchers traced 31 malicious model repositories across 7 accounts, plus 13 related models, with cumulative downloads of 32,376. The attack abuses the Transformers trust_remote_code=True setting, hiding malicious instructions in model definition files that execute with the caller's privileges before weights are loaded, without tampering with weights or exploiting serialization vulnerabilities. After Hugging Face and ModelScope removed the first wave of accounts, the attackers deployed a second wave with new accounts within days, adding 19 malicious repositories, retaining the mining functionality, changing some SSH keys to reverse shells, and adding container escape programs.
The article details the specific methods attackers use to abuse trust_remote_code and the evolution of two waves of campaigns, which teams running self-hosted inference environments can use to check model sources and runtime permissions.