arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2409.09368cs.CRcs.SE
收藏

模型即代码:迈向衡量预训练模型中心上的恶意代码投毒攻击

Models Are Codes: Towards Measuring Malicious Code Poisoning Attacks on Pre-trained Model Hubs

Jian Zhao, Shenao Wang, Yanjie Zhao, Xinyi Hou, Kailong Wang, Peiming Gao, Yuanchao Zhang, Chen Wei, Haoyu Wang

AI总结:

本文针对 Hugging Face 等预训练模型中心的恶意代码投毒风险,提出融合脚本提取、反序列化、污点分析与模式匹配的 MalHug 流水线,并经大规模工业部署验证有效。

摘要:

预训练模型(PTM)和数据集的激增催生了 Hugging Face 等集中式模型中心,促进了协作开发与复用。然而,近期安全报告揭示了这些平台中存在的漏洞和恶意攻击实例,凸显出日益增长的安全担忧。本文首次对预训练模型中心上的恶意代码投毒攻击进行系统研究,重点关注 Hugging Face 平台。我们开展了全面的威胁分析,建立了模型格式分类体系,并对易受攻击的格式进行了根本原因分析。尽管 Fickling 和 ModelScan 等现有工具能够提供一定保护,但它们在语义级分析和全面威胁检测方面存在局限。为应对这些挑战,我们提出 MalHug,这是一条专为 Hugging Face 定制的端到端流水线,结合数据集加载脚本提取、模型反序列化、深度污点分析和启发式模式匹配,以检测并分类数据集与模型中的恶意代码投毒攻击。通过与领先金融科技公司蚂蚁集团合作,我们已在其基础设施内的一个镜像 Hugging Face 实例上实现并部署 MalHug,且该系统已持续运行三个多月。在此期间,MalHug 监测了超过 705K 个模型和 176K 个数据集,发现 91 个恶意模型和 9 个恶意数据集加载脚本。这些发现揭示了一系列安全威胁,包括反向 shell、浏览器凭据窃取和系统侦察。本工作不仅填补了理解 PTM 供应链安全方面的关键空白,也为增强预训练模型中心的安全性提供了经过工业界检验的实用解决方案。

英文摘要:

The proliferation of pre-trained models (PTMs) and datasets has led to the emergence of centralized model hubs like Hugging Face, which facilitate collaborative development and reuse. However, recent security reports have uncovered vulnerabilities and instances of malicious attacks within these platforms, highlighting growing security concerns. This paper presents the first systematic study of malicious code poisoning attacks on pre-trained model hubs, focusing on the Hugging Face platform. We conduct a comprehensive threat analysis, develop a taxonomy of model formats, and perform root cause analysis of vulnerable formats. While existing tools like Fickling and ModelScan offer some protection, they face limitations in semantic-level analysis and comprehensive threat detection. To address these challenges, we propose MalHug, an end-to-end pipeline tailored for Hugging Face that combines dataset loading script extraction, model deserialization, in-depth taint analysis, and heuristic pattern matching to detect and classify malicious code poisoning attacks in datasets and models. In collaboration with Ant Group, a leading financial technology company, we have implemented and deployed MalHug on a mirrored Hugging Face instance within their infrastructure, where it has been operational for over three months. During this period, MalHug has monitored more than 705K models and 176K datasets, uncovering 91 malicious models and 9 malicious dataset loading scripts. These findings reveal a range of security threats, including reverse shell, browser credential theft, and system reconnaissance. This work not only bridges a critical gap in understanding the security of the PTM supply chain but also provides a practical, industry-tested solution for enhancing the security of pre-trained model hubs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑