通过仓库级图结构提升安全补丁检测准确率
Repository-Level Graph Representation Learning for Enhanced Security Patch Detection
- 构建仓库级代码图,融合补丁前后源码关系
- 在两个数据集上准确率分别提升11.9%和3.1%
- 适合关注软件安全维护的开发者与研究者
软件厂商常无声发布安全补丁,缺乏充分通告或延迟更新,导致安全维护困难。现有方法多聚焦补丁内部信息,忽视仓库内复杂依赖关系,且补丁常涉及多函数、多文件,难以有效学习表示。为此,本文提出仓库级安全补丁检测框架RepoSPD,包含三部分:1)仓库级图构建RepoCPG,合并补丁前后源码构建图;2)结构感知补丁表示,融合图与序列分支以理解多处代码变更关系;3)渐进式学习,平衡语义与结构信息。在两个主流数据集SPI-DB和PatchDB上扩展为仓库级版本(SPI-DB*含20,238个版本,PatchDB*含28,781个版本,均为C/C++)。对比六种现有方法与五种静态工具,RepoSPD在两项数据集上的准确率分别提升11.90%和3.10%,优于当前最佳基线。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。