《電子技術(shù)應(yīng)用》
您所在的位置:首頁 > 測(cè)試測(cè)量 > 設(shè)計(jì)應(yīng)用 > 基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)的代碼漏洞檢測(cè)
基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)的代碼漏洞檢測(cè)
網(wǎng)絡(luò)安全與數(shù)據(jù)治理 5期
潘禺涵1,舒遠(yuǎn)仲1,洪 晟2,羅 斌1,聶云峰1
(1.南昌航空大學(xué) 信息工程學(xué)院,江西 南昌330000;2.北京航空航天大學(xué) 網(wǎng)絡(luò)安全空間學(xué)院,北京100191)
摘要: 針對(duì)常規(guī)漏洞檢測(cè)技術(shù)提取漏洞特征困難,存在高誤報(bào)率和高漏報(bào)率的問題,提出了一種基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)以及關(guān)系結(jié)構(gòu)圖注意力機(jī)制的源代碼漏洞檢測(cè)模型。首先通過代碼屬性圖提取代碼的語法和語義信息,并按照不同的語義關(guān)系劃分成不同的關(guān)系結(jié)構(gòu)圖,實(shí)現(xiàn)了代碼表示能力的增強(qiáng)。然后使用圖神經(jīng)網(wǎng)絡(luò)對(duì)圖結(jié)構(gòu)進(jìn)行表示學(xué)習(xí),在網(wǎng)絡(luò)模型中引入后向邊以及關(guān)系結(jié)構(gòu)圖注意力機(jī)制,達(dá)到了更有效的學(xué)習(xí)漏洞特征的效果。最后為了驗(yàn)證模型的優(yōu)勢(shì),在大型真實(shí)數(shù)據(jù)集上對(duì)模型進(jìn)行了廣泛評(píng)估,實(shí)驗(yàn)結(jié)果證明了該方法有效提高了漏洞檢測(cè)能力。
中圖分類號(hào): TP311
文獻(xiàn)標(biāo)識(shí)碼: A
DOI: 10.19358/j.issn.2097-1788.2022.05.006
引用格式: 潘禺涵,舒遠(yuǎn)仲,洪晟,等. 基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)的代碼漏洞檢測(cè)[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]被廣泛用于檢測(cè)漏洞。傳統(tǒng)的檢測(cè)方法主要通過一些由人類專家定義的度量標(biāo)準(zhǔn)所實(shí)現(xiàn)。這些方法目前取得的成果非常有限,因?yàn)樗鼈儫o法避免人類專家在特征提取方面的繁重工作[4],而且用手工制作的特征來覆蓋所有漏洞是不切實(shí)際的。深度學(xué)習(xí)由于具有處理大量軟件代碼和漏洞數(shù)據(jù)的強(qiáng)大能力,被引入到代碼漏洞檢測(cè)領(lǐng)域。然而,現(xiàn)有基于深度學(xué)習(xí)的方法中不同形式的代碼表示方式只能保留部分語法或語義信息,這樣就不能覆蓋到每種漏洞并會(huì)限制模型檢測(cè)的效果。其次這些方法所使用的網(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)對(duì)上述的問題,本文提出了一種基于多關(guān)系結(jié)構(gòu)圖神經(jīng)網(wǎng)絡(luò)的漏洞檢測(cè)方法。采用多關(guān)系結(jié)構(gòu)圖進(jìn)行代碼的圖形表示,獲取全面的程序結(jié)構(gòu)信息。然后結(jié)合雙向圖神經(jīng)網(wǎng)絡(luò)以及關(guān)系結(jié)構(gòu)圖注意力機(jī)制進(jìn)行表示學(xué)習(xí)得到最終的代碼圖全局特征向量,并使用softmax分類器進(jìn)行分類。




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



作者信息:

潘禺涵1,舒遠(yuǎn)仲1,洪  晟2,羅  斌1,聶云峰1

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



微信圖片_20210517164139.jpg

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