[论文解读] Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks
Devign 提出一种图神经网络,学习来自多种代码表示的组合程序语义,以识别易受攻击的函数,并结合用于图级分类的专用 Conv 模块,超越基线方法。
Vulnerability identification is crucial to protect the software systems from attacks for cyber security. It is especially important to localize the vulnerable functions among the source code to facilitate the fix. However, it is a challenging and tedious process, and also requires specialized security expertise. Inspired by the work on manually-defined patterns of vulnerabilities from various code representation graphs and the recent advance on graph neural networks, we propose Devign, a general graph neural network based model for graph-level classification through learning on a rich set of code semantic representations. It includes a novel Conv module to efficiently extract useful features in the learned rich node representations for graph-level classification. The model is trained over manually labeled datasets built on 4 diversified large-scale open-source C projects that incorporate high complexity and variety of real source code instead of synthesis code used in previous works. The results of the extensive evaluation on the datasets demonstrate that Devign outperforms the state of the arts significantly with an average of 10.51% higher accuracy and 8.68\\% F1 score, increases averagely 4.66% accuracy and 6.37% F1 by the Conv module.
研究动机与目标
- 在函数层面动机化漏洞识别,以在大型代码库中定位安全缺陷。
- 通过从多种表示(AST、CFG、DFG 和令牌序列)构建联合图来编码丰富的程序语义。
- 用新颖的 Conv 模块训练图神经网络,以实现对易受攻击函数的有效图级分类。
- 在四个大型开源 C 项目的人工标注数据集上进行评估,并与静态分析器及基线方法进行比较。
提出的方法
- 通过整合 AST、CFG、DFG(表示为 LastRead/LastWrite/ComputedFrom)以及自然代码序列边,将复合代码图构建为带节点特征的异构图(节点特征包括通过 word2vec 表示的代码词元和节点类型)。
- 使用门控图递归网络在边类型之间传播并更新节点嵌入,采用基于 GRU 的融合(方程式 3 和 4)。
- 应用由一维卷积和全连接层组成的 Conv 模块,从节点表示中提取图级特征(方程式 6-9)。
- 端到端训练,采用交叉熵损失并加入正则化,以预测易受攻击与非易受攻击函数(方程式 1)。
- 通过从与安全相关的提交和人工验证中获取易受攻击/非易受攻击函数,准备来自 Linux Kernel、QEMU、Wireshark 和 FFmpeg 的人工标注数据集。
实验结果
研究问题
- RQ1在真实代码上,Devign 是否能超越最先进的基于学习的漏洞识别方法?
- RQ2Conv 模块是否在图级分类上优于对节点嵌入简单求和?
- RQ3从复合图(结合多种代码表示)学习是否优于仅使用单边图的漏洞检测?
- RQ4在不平衡设置和最新 CVE 上,Devign 的表现如何?
- RQ5Devign 是否能泛化到通过新标注数据集中的 CVEs 识别的零日漏洞?
主要发现
- 使用复合代码表示的 Devign 在多个数据集(Linux Kernel、QEMU、Wireshark、FFmpeg)上达到比基线方法更高的准确率和 F1 分数。
- Conv 模块在简单的基于求和的图分类的门控图递归网络上额外提高了准确性和 F1 分数。
- 单边图有时也具备竞争力,但复合图通常提供更优或可比的性能,使用复合表示时准确率和 F1 的平均提升。
- 在不平衡设置中,Devign及其复合图方法优于静态分析器,F1 分数显著更高。
- 应用于40个 CVE,Devign 在提取的易受攻击函数上实现了平均准确率 74.11%,表明具有实际适用性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。