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

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




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



作者信息:

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

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



微信圖片_20210517164139.jpg

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