arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.14565cs.CRcs.SE
收藏

SPI:通过提交自动识别安全补丁

SPI: Automated Identification of Security Patches via Commits

Yaqin Zhou, Jing Kai Siow, Chenyu Wang, Shangqing Liu, Yang Liu

摘要:

开源软件中的安全补丁,为已识别的漏洞提供安全修复,对于防范网络攻击至关重要。尽管国家漏洞数据库(NVD)发布了已识别的漏洞,但绝大多数漏洞及其相应的安全补丁仍然无法公开,例如,开发者非常依赖的开源库中。一个广泛的安全补丁数据集可以帮助最终用户,如安全公司,建立安全知识库,或研究人员,例如,协助脆弱性研究。为了以大规模和低成本管理包括未公开补丁在内的安全补丁,我们提出了一种基于开源库提交的基于深度神经网络的方法。我们构建了安全补丁数据集,其中包括来自四个C库的38,291个安全相关提交和1,045个CVE补丁。我们手动验证38,291个与安全相关的提交中的每个提交,以确定它们是否与安全相关。我们设计了一个基于深度学习的安全补丁识别系统,该系统由两个神经网络组成:一个是提交消息神经网络,它利用从我们的提交数据集学习的预训练单词表示;另一个是代码修订神经网络,它在修订之前和之后获取代码,并学习语句级别上的区别。我们的评估结果表明,我们的系统优于SVM和K-折叠堆叠算法,实现高达87.93%的F1分数和精度为86.24%。我们在工业生产环境中部署了我们的管道和学习模型,以评估我们的方法的泛化能力。工业数据集由来自410个新库的298,917个提交组成,这些库的功能范围很广。我们的实验结果和观察证明,我们的方法可以有效地识别开源项目中的安全补丁。

英文摘要:

Security patches in open-source software, providing security fixes to identified vulnerabilities, are crucial in protecting against cyberattacks. Despite the National Vulnerability Database (NVD) publishes identified vulnerabilities, a vast majority of vulnerabilities and their corresponding security patches remain beyond public exposure, e.g., in the open-source libraries that are heavily relied on by developers. An extensive security patches dataset could help end-users such as security companies, e.g., building a security knowledge base, or researchers, e.g., aiding in vulnerability research. To curate security patches including undisclosed patches at a large scale and low cost, we propose a deep neural-network-based approach built upon commits of open-source repositories. We build security patch datasets that include 38,291 security-related commits and 1,045 CVE patches from four C libraries. We manually verify each commit, among the 38,291 security-related commits, to determine if they are security-related. We devise a deep learning-based security patch identification system that consists of two neural networks: one commit-message neural network that utilizes pretrained word representations learned from our commits dataset; and one code-revision neural network that takes code before and after revision and learns the distinction on the statement level. Our evaluation results show that our system outperforms SVM and K-fold stacking algorithm, achieving as high as 87.93% F1-score and precision of 86.24%. We deployed our pipeline and learned model in an industrial production environment to evaluate the generalization ability of our approach. The industrial dataset consists of 298,917 commits from 410 new libraries that range from a wide functionality. Our experiment results and observation proved that our approach identifies security patches effectively among open-sourced projects.

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

↑