Chinese Journal of Network and Information Security ›› 2021, Vol. 7 ›› Issue (3): 37-45.doi: 10.11959/j.issn.2096-109x.2021039

• TopicⅠ: Application of neural network technology • Previous Articles     Next Articles

Code vulnerability detection method based on graph neural network

Hao CHEN, Ping YI   

  1. School of Cyber Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, China
  • Revised:2020-12-15 Online:2021-06-15 Published:2021-06-01
  • Supported by:
    The National Key R&D Program of China(2019YFB1405000);The National Key R&D Program of China(2017YFB0802900)

Abstract:

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.

Key words: vulnerability detection, graph neural network, control flow graph, intermediate representation

CLC Number: 

No Suggested Reading articles found!