arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2112.10893cs.SEcs.LG
收藏

VELVET:自动定位VulnErable sTatements的noVel包围学习方法

VELVET: a noVel Ensemble Learning approach to automatically locate VulnErable sTatements

Columbia University(哥伦比亚大学);IBM Research(IBM研究院)

Yangruibo Ding, Sahil Suneja, Yunhui Zheng, Jim Laredo, Alessandro Morari, Gail Kaiser, Baishakhi Ray

摘要:

自动定位源代码中的易受攻击语句对于保证软件安全和减轻开发人员的调试工作至关重要。这在当今的软件生态系统中变得更加重要,脆弱的代码可以在GitHub等软件存储库内和跨软件存储库轻松且无意地流动。在这样数百万行代码中,传统的静态和动态方法难以扩展。尽管现有的基于机器学习的方法在这样的环境中看起来很有前途,但大多数工作都是在更高的粒度上检测易受攻击的代码-在方法或文件级别。因此,开发人员仍然需要检查大量的代码来定位需要修复的易受攻击的语句。本文提出了VELVET,一种新的集成学习方法来定位脆弱语句。我们的模型结合了基于图和基于序列的神经网络,成功地捕捉程序图的局部和全局上下文,并有效地理解代码语义和脆弱模式。为了研究VELVET的有效性,我们使用了现成的合成数据集和最近发表的真实世界数据集。在静态分析设置中,没有提前检测到易受攻击的函数,VELVET在实际数据上的性能比基线静态分析器高4.5倍。对于孤立的漏洞本地化任务,我们假设一个功能的漏洞是已知的,而具体的脆弱的语句是未知的,我们比较VELVET与几个神经网络,也出席本地和全球范围内的代码。VELVET在合成数据和真实世界数据上分别实现了99.6%和43.6%的top-1准确率,比基线深度学习模型高出5.3- 29.0%。

英文摘要:

Automatically locating vulnerable statements in source code is crucial to assure software security and alleviate developers' debugging efforts. This becomes even more important in today's software ecosystem, where vulnerable code can flow easily and unwittingly within and across software repositories like GitHub. Across such millions of lines of code, traditional static and dynamic approaches struggle to scale. Although existing machine-learning-based approaches look promising in such a setting, most work detects vulnerable code at a higher granularity -- at the method or file level. Thus, developers still need to inspect a significant amount of code to locate the vulnerable statement(s) that need to be fixed. This paper presents VELVET, a novel ensemble learning approach to locate vulnerable statements. Our model combines graph-based and sequence-based neural networks to successfully capture the local and global context of a program graph and effectively understand code semantics and vulnerable patterns. To study VELVET's effectiveness, we use an off-the-shelf synthetic dataset and a recently published real-world dataset. In the static analysis setting, where vulnerable functions are not detected in advance, VELVET achieves 4.5x better performance than the baseline static analyzers on the real-world data. For the isolated vulnerability localization task, where we assume the vulnerability of a function is known while the specific vulnerable statement is unknown, we compare VELVET with several neural networks that also attend to local and global context of code. VELVET achieves 99.6% and 43.6% top-1 accuracy over synthetic data and real-world data, respectively, outperforming the baseline deep-learning models by 5.3-29.0%.

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

↑