paperbot · PL 论文追踪

全部论文 待读 收藏

P2 1+1>2: Integrating Deep Code Behaviors with Metadata Features for Malicious PyPI Package Detection

1+1>2:融合深度代码行为与元数据特征用于恶意 PyPI 包检测
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 3/10 · 该论文属于用机器学习做代码安全(恶意 PyPI 包检测),虽涉及代码行为序列与 BERT 等代码表示学习,但既非在 ML/Agent 程序中做静态分析,也非用 LLM/Agent 改进静态分析或形式化验证,与浮点程序分析、贝叶斯程序分析亦无关联,仅与'代码+ML'大方向有边缘交集。引用 25 inbox
Xiaobing Sun, Xingan Gao, Sicong Cao, Lili Bo, Xiaoxue Wu, Kaifeng Huang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 Ea4mp,融合代码行为深度特征与元数据特征,提升恶意 PyPI 包检测精度与召回,并发现新恶意包。

针对 PyPI 恶意包上传激增,现有专家规则昂贵且难跟上恶意行为演化,纯代码深度特征在某些情况下不够准确。本文提出 Ea4mp:从所有脚本文件中抽取代码行为序列,微调 BERT 学习恶意代码深层语义特征,并构建集成分类器融合深度代码行为特征与元数据特征。在新数据集上与三个先进基线对比,精度提升 6.9%-24.6%,召回提升 10.5%-18.4%;三周内从 46,573 个新上传包中识别出 119 个未知恶意包,其中 82 个被 PyPI 官方移除。

问题
如何有效检测恶意 PyPI 包:专家规则成本高且难以应对快速演化的恶意行为,而仅靠代码自动提取的深度特征在部分场景下不够准确。
方法
Ea4mp 从脚本文件提取代码行为序列并微调 BERT 获得深度语义特征,再构建集成分类器将代码行为特征与元数据特征结合进行检测。
评估
在新构建数据集上与三个 SOTA 基线比较,精度和召回分别提升 6.9%-24.6% 与 10.5%-18.4%,并在三周内从 46,573 个新包中发现 119 个未知恶意包,82 个被官方移除。
原文摘要(Abstract)

PyPI, the official package registry for Python, has seen a surge in the number of malicious package uploads in recent years. Prior studies have demonstrated the effectiveness of learning-based solutions in malicious package detection. However, manually-crafted expert rules are expensive and struggle to keep pace with the rapidly evolving malicious behaviors, while deep features automatically extracted from code are still inaccurate in certain cases. To mitigate these issues, in this paper, we propose Ea4mp, a novel approach which integrates deep code behaviors with metadata features to detect malicious PyPI packages. Specifically, Ea4mp extracts code behavior sequences from all script files and fine-tunes a BERT model to learn deep semantic features of malicious code. In addition, we realize the value of metadata information and construct an ensemble classifier to combine the strengths of deep code behavior features and metadata features for more effective detection. We evaluated Ea4mp against three state-of-the-art baselines on a newly constructed dataset. The experimental results show that Ea4mp improves precision by 6.9%-24.6% and recall by 10.5%-18.4%. With Ea4mp, we successfully identified 119 previously unknown malicious packages from a pool of 46,573 newly-uploaded packages over a three-week period, and 82 out of them have been removed by the PyPI official.CCS CONCEPTS• Security and privacy → Malware and its mitigation.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{0001GCB0024,
  title = {1+1>2: Integrating Deep Code Behaviors with Metadata Features for Malicious PyPI Package Detection},
  author = {Xiaobing Sun and Xingan Gao and Sicong Cao and Lili Bo and Xiaoxue Wu and Kaifeng Huang},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695493}
}