trust_remote_code挖矿攻击链曝光
The Next Web引述Pluto Security的分析称,Hugging Face Hub上的挖矿活动通过trust_remote_code=True模型加载路径执行Python代码,而非利用漏洞。恶意仓库伪装成小型Qwen2模型,通过导入Python模块建立持久化、开启反向Shell、下载伪装矿工并上报状态。Pluto Security称,仓库扫描器因该Python载荷既不匹配已知恶意软件特征,也不属于序列化模型格式而将其判定为安全。
这起活动表明,启用trust_remote_code可能让模型仓库获得代码执行和持久访问能力,而扫描结果干净并不能证明模型仓库可信。

The trick at the center of this campaign is not an exploit. It is a feature. Pluto Security’s analysis of a cryptominer operation on the Hugging Face Hub shows that the attacker never needed to break anything. The model-loading library runs the Python that infects a machine exactly as designed.
Three doors, one left open
Loading an open model can run code through three different doors. One is the parser that reads a binary format such as GGUF. That is the surface behind CVE-2024-34359, where a chat template stored in a GGUF file executed code through llama-cpp-python.
#Pluto Security#Hugging Face#Transformers#Qwen2#peakminer#Xinference#llama-cpp-python