arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2304.08396cs.SE
收藏

基于代码中心学习的即时漏洞检测

Code-centric Learning-based Just-In-Time Vulnerability Detection

Son Nguyen, Thu-Trang Nguyen, Thanh Trong Vu, Thanh-Dat Do, Kien-Tuan Ngo, Hieu Dinh Vo

AI总结:

本文提出基于代码中心学习的即时漏洞检测方法CodeJIT,通过图神经网络建模提交中代码变更的结构与依赖语义,在20K+真实提交数据集上显著超越现有方法,并具备识别修复漏洞但引入新问题的提交的能力。

摘要:

利用软件漏洞对计算机系统发起的攻击可能对现代社会和经济的网络基础设施造成重大损害。为尽可能减少后果,尽早检测并修复漏洞至关重要。即时漏洞检测(JIT-VD)用于发现易引入漏洞的(“危险”)提交,以防止其被合并到源代码中并引发漏洞。通过JIT-VD,提交作者由于对提交内容有充分理解,可以在相关修改仍然记忆清晰时审查这些危险提交并在必要时进行修复。本文提出CodeJIT,一种新颖的基于代码中心学习的即时漏洞检测方法。CodeJIT的核心思想是:提交中代码变更的含义是判断该提交是否对代码构成危险的直接且决定性因素。基于这一思想,我们设计了一种新颖的基于图的表示方法,从代码结构和程序依赖两方面表示代码变更的语义。我们开发了一个图神经网络模型,用于捕获由基于图的表示所表达的代码变更含义,并学习区分危险提交与安全提交。我们在包含1998年至2022年间506个真实世界项目中20K+危险与安全提交的数据集上进行了实验,以评估CodeJIT的JIT-VD性能。结果表明,CodeJIT显著优于现有最先进的JIT-VD方法,Recall最高提升66%,Precision最高提升136%,F1最高提升68%。此外,CodeJIT能够正确分类近9/10的危险/安全(良性)提交,甚至检测出69个修复了漏洞却在源代码中引入其他问题的提交。

英文摘要:

Attacks against computer systems exploiting software vulnerabilities can cause substantial damage to the cyber-infrastructure of our modern society and economy. To minimize the consequences, it is vital to detect and fix vulnerabilities as soon as possible. Just-in-time vulnerability detection (JIT-VD) discovers vulnerability-prone ("dangerous") commits to prevent them from being merged into source code and causing vulnerabilities. By JIT-VD, the commits' authors, who understand the commits properly, can review these dangerous commits and fix them if necessary while the relevant modifications are still fresh in their minds. In this paper, we propose CodeJIT, a novel code-centric learning-based approach for just-in-time vulnerability detection. The key idea of CodeJIT is that the meaning of the code changes of a commit is the direct and deciding factor for determining if the commit is dangerous for the code. Based on that idea, we design a novel graph-based representation to represent the semantics of code changes in terms of both code structures and program dependencies. A graph neural network model is developed to capture the meaning of the code changes represented by our graph-based representation and learn to discriminate between dangerous and safe commits. We conducted experiments to evaluate the JIT-VD performance of CodeJIT on a dataset of 20K+ dangerous and safe commits in 506 real-world projects from 1998 to 2022. Our results show that CodeJIT significantly improves the state-of-the-art JIT-VD methods by up to 66% in Recall, 136% in Precision, and 68% in F1. Moreover, CodeJIT correctly classifies nearly 9/10 of dangerous/safe (benign) commits and even detects 69 commits that fix a vulnerability yet produce other issues in source code

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

↑