arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2006.08614cs.SEcs.CRcs.LGcs.PL
收藏

学习使用代码即图将source code映射到软件漏洞

Learning to map source code to software vulnerability using code-as-a-graph

IBM Research(IBM研究院)

Sahil Suneja, Yunhui Zheng, Yufan Zhuang, Jim Laredo, Alessandro Morari

摘要:

我们从安全的角度探讨了图神经网络在学习源代码的细微差别方面的适用性。具体来说,源代码中的漏洞签名是否可以从其图表示中学习,根据节点和边缘之间的关系。我们创建了一个称为AI4VA的管道,它首先将示例源代码编码为代码属性图。然后以保留其语义信息的方式对所提取的图进行矢量化。然后,使用多个此类图来训练门控图神经网络,以自动提取区分脆弱样本图和健康样本图的模板。我们的模型在我们实验的三个数据集中的两个数据集上优于静态分析器,经典机器学习以及基于CNN和RNN的深度学习模型。因此,我们表明,代码作为图形编码是更有意义的漏洞检测比现有的代码作为照片和线性序列编码方法。(2019年10月提交,论文#28,ICST)

英文摘要:

We explore the applicability of Graph Neural Networks in learning the nuances of source code from a security perspective. Specifically, whether signatures of vulnerabilities in source code can be learned from its graph representation, in terms of relationships between nodes and edges. We create a pipeline we call AI4VA, which first encodes a sample source code into a Code Property Graph. The extracted graph is then vectorized in a manner which preserves its semantic information. A Gated Graph Neural Network is then trained using several such graphs to automatically extract templates differentiating the graph of a vulnerable sample from a healthy one. Our model outperforms static analyzers, classic machine learning, as well as CNN and RNN-based deep learning models on two of the three datasets we experiment with. We thus show that a code-as-graph encoding is more meaningful for vulnerability detection than existing code-as-photo and linear sequence encoding approaches. (Submitted Oct 2019, Paper #28, ICST)

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

↑