Hao CHEN, Ping YI. Code vulnerability detection method based on graph neural network[J]. Chinese Journal of Network and Information Security, 2021, 7(3): 37-45.
DOI:
Hao CHEN, Ping YI. Code vulnerability detection method based on graph neural network[J]. Chinese Journal of Network and Information Security, 2021, 7(3): 37-45. DOI: 10.11959/j.issn.2096-109x.2021039.
Code vulnerability detection method based on graph neural network
The schemes of using neural networks for vulnerability detection are mostly based on traditional natural language processing ideas
processing the code as array samples and ignoring the structural features in the code
which may omit possible vulnerabilities.A code vulnerability detection method based on graph neural network was proposed
which realized function-level code vulnerability detection through the control flow graph feature of the intermediate language.Firstly
the source code was compiled into an intermediate representation
and then the control flow graph containing structural information was extracted.At the same time
the word vector embedding algorithm was used to initialize the vector of basic block to extract the code semantic information.Then both of above were spliced to generate the graph structure sample data.The multilayer graph neural network model was trained and tested on graph structure data features.The open source vulnerability sample data set was used to generate test data to evaluate the method proposed.The results show that the method effectively improves the vulnerability detection ability.
“National Cyberspace Security Strategy” (full-text) [J ] . China Information Security , 2017 ( 1 ): 26 - 31 .
WU Z , PAN S , CHEN F , et al . A comprehensive survey on graph neural networks [J ] . arXiv:1901.00596 , 2019 .
PHAM N H , NGUYEN T T , NGUYEN H A , et al . Detection of recurring software vulnerabilities [C ] // 25th IEEE/ACM International Conference on Automated Software Engineering . 2010 .
YAMAGUCHI F , GOLDE N , ARP D , et al . Modeling and discovering vulnerabilities with code property graphs [C ] // IEEE Symposium on Security and Privacy . 2014 .
LIN G , ZHANG J , LUO W , et al . POSTER:vulnerability discovery with function representation learning from unlabeled projects [C ] // ACM Sigsac Conference . 2017 .
RUSSELL R , KIM L , HAMILTON L , et al . Automated vulnerability detection in source code using deep representation learning [C ] // 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA) . 2018 : 757 - 762 .
XU X , LIU C , FENG Q , et al . Neural network-based graph embedding for cross-platform binary code similarity detection [C ] // Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security-(CCS′17) . 2017 : 363 - 376 .
LI Y , GU C , DULLIEN T , et al . Graph matching networks for learning the similarity of graph structured objects [C ] // Thirty-sixth International Conference on Machine Learning(ICML 2019) . 2019 .
YU Z , CAO R , TANG Q , et al . Order matters:semantic-aware neural networks for binary code similarity detection [C ] // The Thirty-Fourth AAAI Conference on Artificial Intelligence (AAAI-20) . 2020 .
DUAN Y , LI X , WANG J , et al . DeepBinDiff:learning program-wide code representations for binary diffing [C ] // Proceedings 2020 Network and Distributed System Security Symposium . 2020 .
LI Z , ZOU D Q , WANG Z L , et al . Survey on static software vulnerability detection for source code [J ] . Chinese Journal of Network and Information Security , 2019 , 5 ( 1 ): 1 - 14 .
GORI M , GABRIELE M , FRANCO S . A new model for learning in graph domains [C ] // IEEE International Joint Conference on Neural Networks . 2005 .
SCARSELLI F , GORI M , TSOI A C , et al . The graph neural network model [J ] . IEEE Transactions on Neural Networks , 2009 , 20 ( 1 ): 61 - 80 .
GILMER J , SCHOENHOLZ S S , RILEY P F , et al . Neural message passing for Quantum chemistry [C ] // Proceedings of the 34th International Conference on Machine Learning-Volume 70 (ICML’17) . 2011 : 1263 - 1272 .
MIKOLOV T , CHEN K , CORRADO G , et al . Efficient estimation of word representations in vector space [J ] . arXiv preprint arXiv:1301.3781 , 2013 .
KIPF T N , WELLING M . Semi-supervised classification with graph convolutional networks [J ] . arXiv preprint arXiv:1609.02907 , 2016 .