错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Source Code Vulnerability Detection Based on Graph Structure Representation and Attention Mechanisms

  • Yiran Sun,
  • Ziqi Wang,
  • Kewei Liu,
  • Baojiang Cui

摘要

With the increasingly serious trend of information security, software vulnerability has become one of the main threats to computer security. How to accurately detect the vulnerabilities in programs is a key issue in the field of information security. However, the accuracy of existing static vulnerability detection methods decreases significantly when detecting vulnerabilities with inconspicuous characteristics. To solve this issue, a function-level vulnerability detection method based on code property graph and attention mechanism is proposed. The method firstly converts the program source code into a code property graph containing semantic feature information and slices it to eliminate redundant information not related to sensitive operations; secondly, the code property graph is encoded into numerical embedding vectors by using BERT; then, a large-scale feature dataset is used to train a neural network based on the attention mechanism; finally, the trained neural network is used to realize the vulnerability detection of the target program. The experimental results show that the accuracy of this method on SARD dataset and GitHub dataset reaches 95.3% and 94.2% respectively, which is a significant improvement compared with the baseline, and proves that this method can effectively improve the accuracy of detecting vulnerabilities with inconspicuous vulnerability features.