用弱监督方法精准定位漏洞代码行,无需逐行标注。
Weakly Supervised Vulnerability Localization via Multiple Instance Learning
- 基于多实例学习,用函数级标签生成伪标签指导语句级定位。
- 在三个数据集上实现顶尖的漏洞定位效果,检测性能相当。
- 适合缺乏专家标注资源的团队快速部署漏洞分析系统。
软件漏洞检测已成为软件安全领域的关键问题,吸引众多研究者关注。以往方法多聚焦于函数或文件级别的粗粒度检测,但开发者仍需手动审查大量代码以定位具体漏洞语句,凸显漏洞定位的重要性。传统定位模型需语句级真实标签,而标注需专业知识,成本高昂。为此,本文提出WAVES(Weakly Supervised Vulnerability Localization via Multiple Instance Learning)方法,无需额外语句级标注即可实现漏洞检测与定位。该方法受多实例学习启发,将函数级标签转化为语句级伪标签,用于训练函数表示向量分类器。在三个主流基准数据集上的实验表明,相较于现有基线,WAVES在漏洞检测上表现相当,在语句级漏洞定位上达到当前最优水平。
原文摘要 · Abstract (English)
Software vulnerability detection has emerged as a significant concern in the field of software security recently, capturing the attention of numerous researchers and developers. Most previous approaches focus on coarse-grained vulnerability detection, such as at the function or file level. However, the developers would still encounter the challenge of manually inspecting a large volume of code inside the vulnerable function to identify the specific vulnerable statements for modification, indicating the importance of vulnerability localization. Training the model for vulnerability localization usually requires ground-truth labels at the statement-level, and labeling vulnerable statements demands expert knowledge, which incurs high costs. Hence, the demand for an approach that eliminates the need for additional labeling at the statement-level is on the rise. To tackle this problem, we propose a novel approach called WAVES for WeAkly supervised Vulnerability Localization via multiplE inStance learning, which does not need the additional statement-level labels during the training. WAVES has the capability to determine whether a function is vulnerable (i.e., vulnerability detection) and pinpoint the vulnerable statements (i.e., vulnerability localization). Specifically, inspired by the concept of multiple instance learning, WAVES converts the ground-truth label at the function-level into pseudo labels for individual statements, eliminating the need for additional statement-level labeling. These pseudo labels are utilized to train the classifiers for the function-level representation vectors. Extensive experimentation on three popular benchmark datasets demonstrates that, in comparison to previous baselines, our approach achieves comparable performance in vulnerability detection and state-of-the-art performance in statement-level vulnerability localization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。