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

Keep It Simple:面向大型代码图的精准漏洞检测

Keep It Simple: Towards Accurate Vulnerability Detection for Large Code Graphs

Xin Peng, Shangwen Wang, Yihao Qin, Bo Lin, Liqian Chen, Xiaoguang Mao

AI总结:

针对现有基于图神经网络的代码漏洞检测方法难适配大型代码图的问题,提出ANGLE方法,通过层次化图精炼降噪缩图、结合Graph Transformer与GNN捕捉长距离依赖,在基准数据集尤其大型代码图上准确率显著优于现有最优方法。

摘要:

软件漏洞检测对高质量软件开发至关重要。近年来,部分研究利用图神经网络(Graph Neural Networks,GNNs)学习代码的图表示并应用于漏洞检测任务,已取得显著成效。然而,现有基于图的方法主要存在两大局限,难以很好地泛化到大型代码图:一是代码图中的噪声信息带来干扰,二是难以捕捉图内的长距离依赖关系。为缓解这些问题,我们提出了一种新型漏洞检测方法ANGLE,其创新性主要体现在层次化图精炼和上下文感知图表征学习两方面。前者分层过滤代码图中的冗余信息,从而缩小图的规模;后者协同使用Graph Transformer与GNN,从全局和局部双视角学习代码图表征,以此捕捉长距离依赖。大量实验在三个广泛使用的基准数据集上展现出可观结果:我们的方法在准确率和F1分数上显著优于其他多个基线模型。尤其在大型代码图中,与当前最优方法AMPLE相比,ANGLE的准确率提升了34.27%-161.93%。这些结果证明了ANGLE在漏洞检测任务中的有效性。

英文摘要:

Software vulnerability detection is crucial for high-quality software development. Recently, some studies utilizing Graph Neural Networks (GNNs) to learn the graph representation of code in vulnerability detection tasks have achieved remarkable success. However, existing graph-based approaches mainly face two limitations that prevent them from generalizing well to large code graphs: (1) the interference of noise information in the code graph; (2) the difficulty in capturing long-distance dependencies within the graph. To mitigate these problems, we propose a novel vulnerability detection method, ANGLE, whose novelty mainly embodies the hierarchical graph refinement and context-aware graph representation learning. The former hierarchically filters redundant information in the code graph, thereby reducing the size of the graph, while the latter collaboratively employs the Graph Transformer and GNN to learn code graph representations from both the global and local perspectives, thus capturing long-distance dependencies. Extensive experiments demonstrate promising results on three widely used benchmark datasets: our method significantly outperforms several other baselines in terms of the accuracy and F1 score. Particularly, in large code graphs, ANGLE achieves an improvement in accuracy of 34.27%-161.93% compared to the state-of-the-art method, AMPLE. Such results demonstrate the effectiveness of ANGLE in vulnerability detection tasks.

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

↑