一句话:提出 MVulD,融合代码文本、图结构与图像三种模态特征进行函数级漏洞检测,显著超越四个基线。
软件漏洞会破坏系统功能,现有基于深度学习的函数级漏洞检测方法通常只使用文本或图等一两种模态,未能充分利用多模态信息;而少数引入图像模态的工作又未保留图像背后重要的图结构。本文提出 MVulD,一种多模态函数级漏洞检测方法:使用预训练模型 UniXcoder 学习源代码的语义信息,用图神经网络提取基于图的表示,并借助计算机视觉技术在保留函数图结构的前提下获得图像表示,最后融合三种模态特征进行漏洞判定。作者在 25,816 个函数上开展大规模实验,结果显示 MVulD 在 F1-score、Accuracy、Precision 和 PR-AUC 上分别比四个最先进基线提升 30.8%–81.3%、12.8%–27.4%、48.8%–115% 和 22.9%–141%。
Software vulnerabilities damage the functionality of software systems. Recently, many deep learning-based approaches have been proposed to detect vulnerabilities at the function level by using one or a few different modalities (e.g., text representation, graph-based representation) of the function and have achieved promising performance. However, some of these existing studies have not completely leveraged these diverse modalities, particularly the underutilized image modality, and the others using images to represent functions for vulnerability detection have not made adequate use of the significant graph structure underlying the images. In this paper, we propose MVulD, a multi-modal-based function-level vulnerability detection approach, which utilizes multi-modal features of the function (i.e., text representation, graph representation, and image representation) to detect vulnerabilities. Specifically, MVulD utilizes a pre-trained model (i.e., UniXcoder) to learn the semantic information of the textual source code, employs the graph neural network to distill graph-based representation, and makes use of computer vision techniques to obtain the image representation while retaining the graph structure of the function. We conducted a large-scale experiment on 25,816 functions. The experimental results show that MVulD improves four state-of-the-art baselines by 30.8%-81.3%, 12.8%-27.4%, 48.8%-115%, and 22.9%-141% in terms of F1-score, Accuracy, Precision, and PR-AUC respectively.