paperbot · PL 论文追踪

全部论文 待读 收藏

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

模型即代码:面向预训练模型枢纽的恶意代码投毒攻击测量研究
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 6/10 · 该论文将污点分析等静态分析技术用于 Hugging Face 预训练模型/数据集的恶意代码检测,契合“PL→AI 在机器学习系统中应用静态分析”的方向,并包含工业界部署案例;但不涉及 Agentic/LLM 程序、浮点或贝叶斯程序分析,属于安全测量与供应链检测。引用 9 inbox
Jian Zhao, Shenao Wang, Yanjie Zhao, Xinyi Hou, Kailong Wang, Peiming Gao, Yuanchao Zhang, Chen Wei, Haoyu Wang
crossref: 2026-09-12

AI 速览

一句话:首个针对 Hugging Face 预训练模型枢纽恶意代码投毒的系统性测量研究,并提出并落地了检测流水线 MalHug。

随着预训练模型与数据集的广泛复用,Hugging Face 等集中式模型枢纽成为协作开发的核心平台,但其上的恶意代码投毒问题日益突出。本文首次对预训练模型枢纽中的恶意代码投毒攻击开展系统性研究:通过全面的威胁分析建立模型格式分类学,并对脆弱格式进行根因分析,指出 Fickling、ModelScan 等现有工具在语义级分析与全面威胁检测上的局限。为此作者提出 MalHug——一条面向 Hugging Face 的端到端流水线,融合数据集加载脚本抽取、模型反序列化、深度污点分析与启发式模式匹配,用于检测并分类数据集与模型中的恶意代码投毒。该工具与蚂蚁集团合作部署于其内部镜像 Hugging Face 实例并运行三个月以上,累计监控超过 70.5 万个模型与 17.6 万个数据集,发现 91 个恶意模型与 9 个恶意数据集加载脚本,涉及反向 shell、浏览器凭据窃取与系统侦察等威胁,为预训练模型供应链安全提供了经工业验证的实用方案。

问题
预训练模型枢纽中的模型文件、数据集加载脚本与反序列化机制可能被植入恶意代码,形成供应链投毒风险,而现有工具缺乏语义级分析与全面的威胁检测能力。
方法
开展威胁分析并构建模型格式分类学与脆弱格式根因分析,进而提出 MalHug 端到端流水线,结合数据集加载脚本抽取、模型反序列化、深度污点分析与启发式模式匹配来检测并分类投毒攻击。
评估
与蚂蚁集团合作,将 MalHug 部署于其内部镜像 Hugging Face 实例并持续运行三个月以上,监控超过 70.5 万个模型和 17.6 万个数据集;共检出 91 个恶意模型与 9 个恶意数据集加载脚本,覆盖反向 shell、凭据窃取与系统侦察等攻击类型。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot8405,
  title = {Models Are Codes: Towards Measuring Malicious Code Poisoning Attacks on Pre-trained Model Hubs},
  author = {Jian Zhao and Shenao Wang and Yanjie Zhao and Xinyi Hou and Kailong Wang and Peiming Gao and Yuanchao Zhang and Chen Wei and Haoyu Wang},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695271}
}