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

语句级漏洞检测:通过信息论和对比学习学习漏洞模式

Statement-Level Vulnerability Detection: Learning Vulnerability Patterns Through Information Theory and Contrastive Learning

Monash University(莫纳什大学);Adelaide University(阿德莱德大学);CSIRO Data61(澳大利亚联邦科学与工业研究组织Data61研究院);Defence Science and Technology Group(国防科学技术集团)

Van Nguyen, Trung Le, Chakkrit Tantithamthavorn, Michael Fu, John Grundy, Hung Nguyen, Seyit Camtepe, Paul Quirk, Dinh Phung

AI总结:

针对函数级标注难以定位漏洞语句的问题,提出融合互信息与聚类空间对比学习的端到端无监督方法,在20万余C/C++函数上显著提升漏洞语句识别性能。

摘要:

软件漏洞是一个严重且至关重要的问题。通常,在由数百或数千条源代码语句组成的程序或函数中,只有少数语句会导致相应的漏洞。当前大多数漏洞标注方法都是由专家在机器学习工具的辅助下,在函数或程序级别完成的。将这种方法扩展到代码语句级别成本更高、更耗时,并且仍然是一个悬而未决的问题。在本文中,我们提出了一种新颖的基于端到端深度学习的方法,用于识别特定函数中与漏洞相关的代码语句。受真实世界漏洞代码中观察到的特定结构启发,我们首先利用互信息学习一组潜在变量,这些变量表示源代码语句与相应函数漏洞的相关性。随后,我们提出了新颖的聚类空间对比学习,以进一步改进表示学习以及与漏洞相关代码语句的鲁棒选择过程。在包含超过20万个C/C++函数的真实世界数据集上的实验结果表明,我们的方法优于其他最先进的基线方法。总体而言,在无监督设置下于真实世界数据集运行时,我们的方法在VCP、VCA和Top-10 ACC指标上取得了比基线高3%至14%的性能。我们发布的源代码示例可在https://github.com/vannguyennd/livuitcl公开获取。

英文摘要:

Software vulnerabilities are a serious and crucial concern. Typically, in a program or function consisting of hundreds or thousands of source code statements, there are only a few statements causing the corresponding vulnerabilities. Most current approaches to vulnerability labelling are done on a function or program level by experts with the assistance of machine learning tools. Extending this approach to the code statement level is much more costly and time-consuming and remains an open problem. In this paper, we propose a novel end-to-end deep learning-based approach to identify the vulnerability-relevant code statements of a specific function. Inspired by the specific structures observed in real-world vulnerable code, we first leverage mutual information for learning a set of latent variables representing the relevance of the source code statements to the corresponding function's vulnerability. We then propose novel clustered spatial contrastive learning in order to further improve the representation learning and the robust selection process of vulnerability-relevant code statements. Experimental results on real-world datasets of 200k+ C/C++ functions show the superiority of our method over other state-of-the-art baselines. In general, our method obtains a higher performance in VCP, VCA, and Top-10 ACC measures of between 3% to 14% over the baselines when running on real-world datasets in an unsupervised setting. Our released source code samples are publicly available at \href{https://github.com/vannguyennd/livuitcl}{https://github.com/vannguyennd/livuitcl.}

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

↑