一句话:Maltracker 以细粒度代码特征与 LLM 增强数据集检测 NPM 恶意包,包级与函数级 F1 分别提升约 12.6% 和 31.0%。
NPM 作为最大的包注册中心,近年成为供应链攻击的首要目标,恶意包泛滥给终端用户带来严重安全风险。基于学习的检测方法适应性强,但存在两点不足:一是多依赖元数据或包级粗粒度代码特征,忽略复杂代码语义;二是训练数据在数量与多样性上都较为匮乏,难以覆盖重要攻击类型。为此作者提出 Maltracker:首先构建精确调用图,提取可达预定义敏感 API 集合的可疑函数,再基于程序依赖图用社区检测算法识别可疑代码片段(gadget),从中抽取细粒度特征;同时利用先进大语言模型将 C/C++、Python、Go 等其他语言中的恶意函数翻译为 JavaScript,以扩充数据集。评估表明,相比当前最优的基于学习的方法,Maltracker 在包级 F1 上提升约 12.6%,函数级提升约 31.0%,消融实验显示各关键组件均有贡献;此外它在 NPM 中新发现 230 个恶意包并收到 61 封致谢信,其中部分恶意行为是现有工具无法检测的。
As the largest package registry, Node Package Manager (NPM) has become the prime target for various supply chain attacks recently and has been flooded with numerous malicious packages, posing significant security risks to end-users. Learning-based methods have demonstrated promising performance with good adaptability to various types of attacks. However, they suffer from two main limitations. First, they often utilize metadata features or coarse-grained code features extracted at the package level while overlooking complex code semantics. Second, the dataset used to train the model often suffers from a lack of variety both in quantity and diversity, and thus cannot detect significant types of attacks. To address these problems, we introduce Maltracker, a learningbased NPM malware tracker based on fine-grained features empowered by LLM-enhanced dataset. First, Maltracker constructs precise call graphs to extract suspicious functions that are reachable to a pre-defined set of sensitive APIs, and then utilizes community detection algorithm to identify suspicious code gadgets based on program dependency graph, from which fine-grained features are then extracted. To address the second limitation, we extend the dataset using advanced large language models (LLM) to translate malicious functions from other languages (e.g., C/C++, Python, and Go) into JavaScript. Evaluations shows that Maltracker can achieve an improvement of about 12.6% in terms of F1-score at the package level and 31.0% at the function level compared with the SOTA learning-based methods. Moreover, the key components of 𝑀𝑎𝑙𝑡𝑟𝑎𝑐𝑘𝑒𝑟 all contribute to the effectiveness of its performance. Finally, Maltracker has also detected 230 new malicious packages in NPM and received 61 thanks letters, among which some contain new malicious behaviors that cannot be detected by existing tools.
DOI 原文 ·
@inproceedings{paperbot8599,
title = {Maltracker: A Fine-Grained NPM Malware Tracker Copiloted by LLM-Enhanced Dataset},
author = {Zeliang Yu and Ming Wen and Xiaochen Guo and Hai Jin},
booktitle = {ISSTA},
year = {2024},
doi = {10.1145/3650212.3680397}
}