arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.11072cs.CRcs.AIcs.LG
收藏

一种基于语义漏洞图的去偏 Transformer 源代码学习

An Unbiased Transformer Source Code Learning with Semantic Vulnerability Graph

University of Texas at San Antonio(德克萨斯大学圣安东尼奥分校);University of the Incarnate Word(圣道大学)

Nafis Tanveer Islam, Gonzalo De La Torre Parra, Dylan Manuel, Elias Bou-Harb, Peyman Najafirad

AI总结:

针对开源软件漏洞筛查效果不佳及数据集分布偏移问题,提出结合 RoBERTa、GCN 与语义漏洞图(SVG)的去偏分类器,引入 Poacher Flow 与 Focal Loss 提升检测性能,在多数据集上表现优异并成功发现多个零日漏洞。

摘要:

多年来,开源软件系统已成为威胁行为者的猎物。即使开源社区迅速采取行动修补漏洞,代码漏洞筛查从一开始就应成为敏捷软件开发不可或缺的一部分。遗憾的是,当前的漏洞筛查技术在识别新型漏洞或为开发者提供代码漏洞及分类方面效果不佳。此外,由于对手部署的新型攻击策略,用于漏洞学习的数据集通常表现出与真实世界测试分布的分布偏移,结果,机器学习模型的性能可能受阻或产生偏差。为解决这些问题,我们提出了一种联合插值多任务去偏漏洞分类器,包含 transformer “RoBERTa” 和图卷积神经网络(GCN)。我们提出了一种利用源代码的语义漏洞图(SVG)表示的训练过程,该表示通过整合顺序流、控制流和数据流的边,以及一种被称为 Poacher Flow(PF)的新型流而创建。Poacher 流边缩小了动态和静态程序分析之间的差距,并处理复杂的长程依赖。此外,我们的方法通过将 Focal Loss 目标函数与 SVG 集成,减少了分类器对不平衡数据集的偏差。值得注意的是,实验结果表明,我们的分类器在漏洞检测上优于最先进的结果,具有更少的假阴性和假阳性。在多个数据集上测试我们的模型后,它在最佳情况下显示出至少 2.41% 和 18.75% 的提升。使用 N-day 程序样本的评估表明,我们提出的方法达到了 93% 的准确率,并能够从流行的 GitHub 仓库中检测出 4 个零日漏洞。

英文摘要:

Over the years, open-source software systems have become prey to threat actors. Even as open-source communities act quickly to patch the breach, code vulnerability screening should be an integral part of agile software development from the beginning. Unfortunately, current vulnerability screening techniques are ineffective at identifying novel vulnerabilities or providing developers with code vulnerability and classification. Furthermore, the datasets used for vulnerability learning often exhibit distribution shifts from the real-world testing distribution due to novel attack strategies deployed by adversaries and as a result, the machine learning model's performance may be hindered or biased. To address these issues, we propose a joint interpolated multitasked unbiased vulnerability classifier comprising a transformer "RoBERTa" and graph convolution neural network (GCN). We present a training process utilizing a semantic vulnerability graph (SVG) representation from source code, created by integrating edges from a sequential flow, control flow, and data flow, as well as a novel flow dubbed Poacher Flow (PF). Poacher flow edges reduce the gap between dynamic and static program analysis and handle complex long-range dependencies. Moreover, our approach reduces biases of classifiers regarding unbalanced datasets by integrating Focal Loss objective function along with SVG. Remarkably, experimental results show that our classifier outperforms state-of-the-art results on vulnerability detection with fewer false negatives and false positives. After testing our model across multiple datasets, it shows an improvement of at least 2.41% and 18.75% in the best-case scenario. Evaluations using N-day program samples demonstrate that our proposed approach achieves a 93% accuracy and was able to detect 4, zero-day vulnerabilities from popular GitHub repositories.

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

↑