arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.08068cs.SEcs.AIcs.CR

用于增强安全补丁检测的仓库级图表示学习

Repository-Level Graph Representation Learning for Enhanced Security Patch Detection

Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));Peng Cheng Laboratory(鹏城实验室);Chongqing University(重庆大学);Anhui Polytechnic University(安徽工程大学)

Xin-Cheng Wen, Zirui Lin, Cuiyun Gao, Hongyu Zhang, Yong Wang, Qing Liao

AI总结:

针对现有安全补丁检测方法忽略仓库依赖、难处理多文件变更的问题,本文提出RepoSPD框架,通过仓库级图构建、结构感知表示和渐进式学习实现检测,在扩展数据集上准确率较最优基线最高提升11.90%。

摘要:

软件供应商通常会悄悄发布安全补丁,却不提供充分的安全公告(如Common Vulnerabilities and Exposures,即通用漏洞披露),也不会通过National Vulnerability Database(国家漏洞数据库)等资源及时更新信息。因此,检测这些安全补丁对于保障软件维护的安全性至关重要。然而现有方法面临以下挑战:(1)它们主要关注补丁本身的信息,忽略了仓库中的复杂依赖关系;(2)安全补丁通常涉及多个函数和文件,增加了充分学习其表示的难度。为缓解上述挑战,本文提出了一个名为RepoSPD的仓库级安全补丁检测框架,该框架包含三个核心组件:1)仓库级图构建模块RepoCPG,通过在仓库层面合并补丁前与补丁后的源代码来表示软件补丁;2)结构感知补丁表示模块,融合图分支与序列分支,旨在理解多处代码变更之间的关联;3)渐进式学习模块,帮助模型平衡语义信息与结构信息。为评估RepoSPD的性能,我们采用了安全补丁检测领域两个广泛使用的数据集:SPI-DB和PatchDB。我们进一步将这些数据集扩展到仓库级别,分别纳入了总计20238个和28781个C/C++编程语言的仓库版本,记为SPI-DB*和PatchDB*。我们将RepoSPD与6种现有的安全补丁检测方法以及5种静态工具进行了对比。实验结果表明,RepoSPD的性能优于当前最优基线,在两个数据集上的准确率分别提升了11.90%和3.10%。

英文摘要:

Software vendors often silently release security patches without providing sufficient advisories (e.g., Common Vulnerabilities and Exposures) or delayed updates via resources (e.g., National Vulnerability Database). Therefore, it has become crucial to detect these security patches to ensure secure software maintenance. However, existing methods face the following challenges: (1) They primarily focus on the information within the patches themselves, overlooking the complex dependencies in the repository. (2) Security patches typically involve multiple functions and files, increasing the difficulty in well learning the representations. To alleviate the above challenges, this paper proposes a Repository-level Security Patch Detection framework named RepoSPD, which comprises three key components: 1) a repository-level graph construction, RepoCPG, which represents software patches by merging pre-patch and post-patch source code at the repository level; 2) a structure-aware patch representation, which fuses the graph and sequence branch and aims at comprehending the relationship among multiple code changes; 3) progressive learning, which facilitates the model in balancing semantic and structural information. To evaluate RepoSPD, we employ two widely-used datasets in security patch detection: SPI-DB and PatchDB. We further extend these datasets to the repository level, incorporating a total of 20,238 and 28,781 versions of repository in C/C++ programming languages, respectively, denoted as SPI-DB* and PatchDB*. We compare RepoSPD with six existing security patch detection methods and five static tools. Our experimental results demonstrate that RepoSPD outperforms the state-of-the-art baseline, with improvements of 11.90%, and 3.10% in terms of accuracy on the two datasets, respectively.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑