Abstract:
In the current code vulnerability detection, researchers only convert source code into Abstract Syntax Tree (AST) or Program Dependency Graph (PDG), but AST focuses more on the syntax structure information of code, and PDG focuses more on the semantic information of code, which leads to the loss of some semantic syntax. In addition, current work does not effectively identify the lines of code in the vulnerability snippet that have a critical impact on the vulnerability. Therefore, VulnImGC (Vulnerability Identification based on multi-feature fusion with GNN and CNN), a new vulnerability detection model based on syntactic semantic trace graph, is proposed. The model first converts the source code into an AST of code behavior nodes with additional jump edges and variable usage edges, and then generates program dependency graph based on the AST. Then, the graph slices are generated by forward and backward slicing techniques, which are standardized and analyzed for centrality to identify core lines of code. The model combines the advantages of GNN (Graph Neural Network) and CNN (Convolutional Neural Network) to extract the overall semantic and structural features as well as the syntactic features of the core lines of code, and then aggregates the features through the attention pooling layer to detect whether the code contains vulnerabilities. The experimental results show that compared with previous work, the model achieves excellent performance on two real world datasets, FFmpeg+Qemu and BigVul.