• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2025, Vol. 47 ›› Issue (5): 851-863.

• 计算机网络与信息安全 • 上一篇    下一篇

基于双曲图卷积神经网络的切片级漏洞检测方法

陈旭1,陈子雄1,景永俊1,王叔洋2,宋吉飞3   

  1. (1.北方民族大学计算机科学与工程学院,宁夏 银川 750021;2.北方民族大学电气信息工程学院,宁夏 银川 750021;
    3.国家(中卫)新型互联网交换中心,宁夏 中卫 755001)

  • 收稿日期:2024-07-04 修回日期:2024-08-29 出版日期:2025-05-25 发布日期:2025-05-27
  • 基金资助:
    北方民族大学中央高校基本科研业务费专项资金(2023ZRLG13);宁夏回族自治区重点研发项目(2023BDE02017)


A slice-level vulnerability detection method based on hyperbolic graph convolutional neural network

CHEN Xu1,CHEN Zixiong1,JING Yongjun1,WANG Shuyang2,SONG Jifei3   

  1. (1.School of Computer Science and Engineering,North Minzu University,Yinchuan 750021;
    2.School of Electrical and Information Engineering,North Minzu University,Yinchuan 750021;
    3.National (Zhongwei) New-type Internet Exchange Center,Zhongwei 750001,China)
  • Received:2024-07-04 Revised:2024-08-29 Online:2025-05-25 Published:2025-05-27

摘要: 针对源代码漏洞检测领域中存在的挑战,特别是现有方法在代码图精准嵌入和捕获其复杂层次结构方面的不足,提出了一种创新的基于双曲图卷积神经网络的切片级源代码漏洞检测方法VulDHGCN。该方法融合了图卷积神经网络和双曲几何的强大表达能力,更全面地嵌入和保留了源代码的结构特征,有效降低了代码图嵌入过程中的信息失真。为了全面评估VulDHGCN的有效性,选择了3种传统的基于规则的静态漏洞检测方法和3种先进的基于模型的漏洞检测方法作为对比基线方法。实验结果表明,在多个关键性能指标上,VulDHGCN均优于基线方法。具体而言,VulDHGCN的准确率、精确率、召回率和F1得分分别达到了96.52%,92.31%,85.12%和88.57%,相较于基线漏洞检测方法,F1分数提高了6.62%~153.92%,具有明显的优势。这不仅证明了VulDHGCN方法的有效性,也为深度学习在源代码漏洞检测领域的进一步应用提供了新的视角和方法。

关键词: 漏洞检测, 切片级别, 低失真嵌入, 双曲空间, 图卷积神经网络

Abstract: Addressing the challenges in the field of source code vulnerability detection, particularly the shortcomings of existing methods in accurately embedding code graphs and capturing their complex hierarchical structures, this paper proposes an innovative slice-level source code vulnerability detection method based on hyperbolic graph convolutional neural network (HGCN), termed VulDHGCN. This method integrates the powerful expressive capabilities of graph convolutional neural networks and hyperbolic geometry to more comprehensively embed and preserve the structural features of source code, effectively reducing information distortion during the code graph embedding process. To comprehensively evaluate the effectiveness of VulDHGCN, three traditional rule-based static vulnerability detection methods and three advanced model-based vulnerability detection methods are selected as comparison baselines. Experimental results demonstrate that VulDHGCN outperforms the baseline methods across multiple key performance indicators. Specifically, VulDHGCN achieves accuracy, precision, recall, and F1 scores of 96.52%, 92.31%, 85.12%, and 88.57%, respectively. Compared to the baseline vulnerability detection methods, VulDHGCN exhibits a significant advantage with an improvement in F1 score ranging from 6.62% to 153.92%. This not only validates the effectiveness of the VulDHGCN method but also provides a new perspective and approach for the further application of deep learning in the field of source code vulnerability detection.

Key words: vulnerability detection, slice-level, low distortion embedding, hyperbolic space, graph convolutional neural network