一句话:提出 OSCAR:面向 NPM/PyPI 的动态投毒检测流水线,通过沙箱执行、模糊测试与切面行为监控降低误报。
开源包生态(尤其 NPM 与 PyPI)供应链投毒攻击激增,现有静态分析误报高且易被混淆/动态执行绕过,动态分析则常捕获非包行为且测试策略简单。OSCAR 是面向 NPM/PyPI 的鲁棒动态检测流水线:在沙箱中完整执行包,对导出函数与类模糊测试,并用切面式监控与定制 API 钩子捕获恶意行为。在真实恶意/良性包基准上,NPM 与 PyPI 的 F1 分别达 0.95/0.91;对具恶意特征的良性包,误报率平均降低 32.06% 和 39.87%(NPM 34.63%→2.57%,PyPI 41.10%→1.23%)。与蚂蚁集团合作部署 18 个月,发现 10,404 个恶意 NPM 包和 1,235 个恶意 PyPI 包。
The exponential growth of open-source package ecosystems, particularly NPM and PyPI, has led to an alarming increase in software supply chain poisoning attacks. Existing static analysis methods struggle with high false positive rates and are easily thwarted by obfuscation and dynamic code execution techniques. While dynamic analysis approaches offer improvements, they often suffer from capturing non-package behaviors and employing simplistic testing strategies that fail to trigger sophisticated malicious behaviors. To address these challenges, we present OSCAR, a robust dynamic code poisoning detection pipeline for NPM and PyPI ecosystems. OSCAR fully executes packages in a sandbox environment, employs fuzz testing on exported functions and classes, and implements aspect-based behavior monitoring with tailored API hook points. We evaluate OSCAR against six existing tools using a comprehensive benchmark dataset of real-world malicious and benign packages. OSCAR achieves an F1 score of 0.95 in NPM and 0.91 in PyPI, confirming that OSCAR is as effective as the current state-of-the-art technologies. Furthermore, for benign packages exhibiting characteristics typical of malicious packages, OSCAR reduces the false positive rate by an average of 32.06% in NPM (from 34.63% to 2.57%) and 39.87% in PyPI (from 41.10% to 1.23%), compared to other tools, significantly reducing the workload of manual reviews in real-world deployments. In cooperation with Ant Group, a leading financial technology company, we have deployed OSCAR on its NPM and PyPI mirrors since January 2023, identifying 10,404 malicious NPM packages and 1,235 malicious PyPI packages over 18 months. This work not only bridges the gap between academic research and industrial application in code poisoning detection but also provides a robust and practical solution that has been thoroughly tested in a real-world industrial setting.CCS CONCEPTS• Security and privacy → Malware and its mitigation; • Software and its engineering → Software libraries and repositories; Open source model.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{ZhengW0ZGZW024,
title = {Towards Robust Detection of Open Source Software Supply Chain Poisoning Attacks in Industry Environments},
author = {Xinyi Zheng and Chen Wei and Shenao Wang and Yanjie Zhao and Peiming Gao and Yuanchao Zhang and Kailong Wang and Haoyu Wang},
booktitle = {ASE},
year = {2024},
doi = {10.1145/3691620.3695262}
}