《電子技術(shù)應(yīng)用》
您所在的位置:首頁 > 测试测量 > 设计应用 > 基于多关系结构图神经网络的代码漏洞检测
基于多关系结构图神经网络的代码漏洞检测
网络安全与数据治理 5期
潘禺涵1,舒远仲1,洪 晟2,罗 斌1,聂云峰1
(1.南昌航空大学 信息工程学院,江西 南昌330000;2.北京航空航天大学 网络安全空间学院,北京100191)
摘要: 针对常规漏洞检测技术提取漏洞特征困难,存在高误报率和高漏报率的问题,提出了一种基于多关系结构图神经网络以及关系结构图注意力机制的源代码漏洞检测模型。首先通过代码属性图提取代码的语法和语义信息,并按照不同的语义关系划分成不同的关系结构图,实现了代码表示能力的增强。然后使用图神经网络对图结构进行表示学习,在网络模型中引入后向边以及关系结构图注意力机制,达到了更有效的学习漏洞特征的效果。最后为了验证模型的优势,在大型真实数据集上对模型进行了广泛评估,实验结果证明了该方法有效提高了漏洞检测能力。
中圖分類號: TP311
文獻標識碼: A
DOI: 10.19358/j.issn.2097-1788.2022.05.006
引用格式: 潘禺涵,舒遠仲,洪晟,等. 基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)的代碼漏洞檢測[J].網(wǎng)絡(luò)安全與數(shù)據(jù)治理,2022,41(5):36-42.
Code vulnerability detection based on multi-relational graph neural network
Pan Yuhan1,Shu Yuanzhong1,Hong Sheng2,Luo Bin1,Nie Yunfeng1
(1.School of Information Engineering,Nanchang Hangkong University,Nanchang 330000,China; 2.School of Cyber Science and Technology,Beihang University,Beijing 100191,China)
Abstract: In order to solve the problem that the conventional vulnerability detection technology is difficult to extract vulnerability features and has high false positive rate and high false negative rate, a source code vulnerability detection model based on multi-relational structure graph neural network and relational structure graph attention mechanism is proposed. Firstly, the syntactic and semantic information of the code is extracted through the code attribute graph, and the code is divided into different relation structure graphs according to different semantic relations, which enhances the code representation ability. Then, the graph neural network is used to represent and learn the graph structure, and the backward edge and the attention mechanism of relational structure graph are introduced into the network model to achieve the effect of more effective learning of vulnerability features. Finally, in order to verify the advantages of the model, the model is extensively evaluated on a large real data set, and the experimental results show that the method can effectively improve the vulnerability detection ability.
Key words : vulnerability detection;graph neural network;attention mechanism;relational graph;graph embedding

0 引言

軟件漏洞是許多系統(tǒng)攻擊[1]和數(shù)據(jù)泄露事件[2]的原因。在軟件產(chǎn)品開發(fā)中,源代碼靜態(tài)分析技術(shù)[3]被廣泛用于檢測漏洞。傳統(tǒng)的檢測方法主要通過一些由人類專家定義的度量標準所實現(xiàn)。這些方法目前取得的成果非常有限,因為它們無法避免人類專家在特征提取方面的繁重工作[4],而且用手工制作的特征來覆蓋所有漏洞是不切實際的。深度學習由于具有處理大量軟件代碼和漏洞數(shù)據(jù)的強大能力,被引入到代碼漏洞檢測領(lǐng)域。然而,現(xiàn)有基于深度學習的方法中不同形式的代碼表示方式只能保留部分語法或語義信息,這樣就不能覆蓋到每種漏洞并會限制模型檢測的效果。其次這些方法所使用的網(wǎng)絡(luò)模型仍存在一些局限性:例如,卷積神經(jīng)網(wǎng)絡(luò)(Convolutional Neural Network,CNN)和循環(huán)神經(jīng)網(wǎng)絡(luò)(Recurrent Neural Network,RNN)是基于序列的模型,不能處理代碼的非序列特征,只能捕獲源代碼文本的淺表結(jié)構(gòu),無法利用程序結(jié)構(gòu)豐富且定義良好的語義。 

為了應(yīng)對上述的問題,本文提出了一種基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)的漏洞檢測方法。采用多關(guān)系結(jié)構(gòu)圖進行代碼的圖形表示,獲取全面的程序結(jié)構(gòu)信息。然后結(jié)合雙向圖神經(jīng)網(wǎng)絡(luò)以及關(guān)系結(jié)構(gòu)圖注意力機制進行表示學習得到最終的代碼圖全局特征向量,并使用softmax分類器進行分類。




本文詳細內(nèi)容請下載:http://ihrv.cn/resource/share/2000005024



作者信息:

潘禺涵1,舒遠仲1,洪  晟2,羅  斌1,聶云峰1

(1.南昌航空大學 信息工程學院,江西 南昌330000;2.北京航空航天大學 網(wǎng)絡(luò)安全空間學院,北京100191)



微信圖片_20210517164139.jpg

此內(nèi)容為AET網(wǎng)站原創(chuàng),未經(jīng)授權(quán)禁止轉(zhuǎn)載。