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

通过保留漏洞特征的数据增强提升代码漏洞检测能力

Enhancing Code Vulnerability Detection via Vulnerability-Preserving Data Augmentation

Shangqing Liu, Wei Ma, Jian Wang, Xiaofei Xie, Ruitao Feng, Yang Liu

AI总结:

针对现有代码漏洞检测忽略漏洞多样性、数据稀缺导致泛化差的问题,提出细粒度检测器FGVulDet,结合多分类器、边感知GGNN与保留漏洞特征的数据增强技术,在五类漏洞数据集上验证了有效性。

摘要:

源代码漏洞检测旨在识别代码中固有的漏洞,以保护软件系统免受潜在攻击。以往许多研究忽略了漏洞的多样特征,将该问题简化为二分类(0-1)任务,例如判断代码是否存在漏洞。这使得单一深度学习模型难以有效学习各类漏洞的广泛特征。此外,由于大规模漏洞数据收集存在难度,这类检测器往往会在有限的训练数据集上过拟合,导致模型泛化性能下降。\n为解决上述挑战,本文提出了一种细粒度漏洞检测器FGVulDet。与现有方法不同,FGVulDet采用多个分类器来识别不同漏洞类型的特征,并结合各分类器的输出判定具体的漏洞类型,每个分类器用于学习特定类型的漏洞语义。同时,为解决部分漏洞类型数据稀缺的问题、提升数据多样性以更好地学习漏洞语义,本文提出了一种新颖的保留漏洞特征的数据增强技术,用于扩充漏洞样本数量。受近期图神经网络在程序语义学习领域的进展启发,本文引入门控图神经网络(Gated Graph Neural Network, GGNN),并将其扩展为边感知GGNN以捕获边类型信息。FGVulDet在来自GitHub的大规模数据集上训练,该数据集涵盖五种不同的漏洞类型。通过与基于静态分析的方法、基于学习的方法进行对比,大量实验验证了FGVulDet的有效性。

英文摘要:

Source code vulnerability detection aims to identify inherent vulnerabilities to safeguard software systems from potential attacks. Many prior studies overlook diverse vulnerability characteristics, simplifying the problem into a binary (0-1) classification task for example determining whether it is vulnerable or not. This poses a challenge for a single deep learning-based model to effectively learn the wide array of vulnerability characteristics. Furthermore, due to the challenges associated with collecting large-scale vulnerability data, these detectors often overfit limited training datasets, resulting in lower model generalization performance. To address the aforementioned challenges, in this work, we introduce a fine-grained vulnerability detector namely FGVulDet. Unlike previous approaches, FGVulDet employs multiple classifiers to discern characteristics of various vulnerability types and combines their outputs to identify the specific type of vulnerability. Each classifier is designed to learn type-specific vulnerability semantics. Additionally, to address the scarcity of data for some vulnerability types and enhance data diversity for learning better vulnerability semantics, we propose a novel vulnerability-preserving data augmentation technique to augment the number of vulnerabilities. Taking inspiration from recent advancements in graph neural networks for learning program semantics, we incorporate a Gated Graph Neural Network (GGNN) and extend it to an edge-aware GGNN to capture edge-type information. FGVulDet is trained on a large-scale dataset from GitHub, encompassing five different types of vulnerabilities. Extensive experiments compared with static-analysis-based approaches and learning-based approaches have demonstrated the effectiveness of FGVulDet.

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

↑