Compact Abstract Graphs for Detecting Code Vulnerability with GNN Models | Proceedings of the 38th Annual Computer Security Applications Conference
Authors:
Open Access
- 5 December 2022
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 497-507
Abstract
Source code representation is critical to the machine-learning-based approach to detecting code vulnerability. This paper proposes Compact Abstract Graphs (CAGs) of source code in different programming languages for predicting a broad range of code vulnerabilities with Graph Neural Network (GNN) models. CAGs make the source code representation aligned with the task of vulnerability classification and reduce the graph size to accelerate model training with minimum impact on the prediction performance. We have applied CAGs to six GNN models and large Java/C datasets with 114 vulnerability types in Java programs and 106 vulnerability types in C programs. The experiment results show that the GNN models have performed well, with accuracy ranging from 94.7% to 96.3% on the Java dataset and from 91.6% to 93.2% on the C dataset. The resultant GNN models have achieved promising performance when applied to more than 2,500 vulnerabilities collected from real-world software projects. The results also show that using CAGs for GNN models is significantly better than ASTs, CFGs (Control Flow Graphs), and PDGs (Program Dependence Graphs). A comparative study has demonstrated that the CAG-based GNN models can outperform the existing methods for machine learning-based vulnerability detection.Keywords
Funding Information
- NSF (1820685)
This publication has 24 references indexed in Scilit:
- End-to-End Prediction of Buffer Overruns from Raw Source Code via Neural Memory Networks2017
- SourcererCC2016
- Automatically learning semantic features for defect prediction2016
- Predicting Vulnerable Software Components through N-Gram Analysis and Statistical Feature Selection2015
- Building Program Vector Representations for Deep Learning2015
- MARFCAT: Fast code analysis for defects and vulnerabilities2015
- Predicting Vulnerable Software Components via Text MiningIEEE Transactions on Software Engineering, 2014
- Software vulnerability prediction using text analysis techniques2012
- WEKA: a machine learning workbench2002
- Individual Comparisons by Ranking Methods1992