[Paper Review] VulSPG: Vulnerability detection based on slice property graph representation learning
VulSPG proposes a novel code representation called Slice Property Graph (SPG) that captures vulnerability-relevant semantics and structure while minimizing irrelevant code, and introduces an R-GCN model with triple attention mechanism to improve vulnerability detection. Evaluated on real-world datasets, VulSPG outperforms state-of-the-art methods in both accuracy and efficiency.
Vulnerability detection is an important issue in software security. Although various data-driven vulnerability detection methods have been proposed, the task remains challenging since the diversity and complexity of real-world vulnerable code in syntax and semantics make it difficult to extract vulnerable features with regular deep learning models, especially in analyzing a large program. Moreover, the fact that real-world vulnerable codes contain a lot of redundant information unrelated to vulnerabilities will further aggravate the above problem. To mitigate such challenges, we define a novel code representation named Slice Property Graph (SPG), and then propose VulSPG, a new vulnerability detection approach using the improved R-GCN model with triple attention mechanism to identify potential vulnerabilities in SPG. Our approach has at least two advantages over other methods. First, our proposed SPG can reflect the rich semantics and explicit structural information that may be relevance to vulnerabilities, while eliminating as much irrelevant information as possible to reduce the complexity of graph. Second, VulSPG incorporates triple attention mechanism in R-GCNs to achieve more effective learning of vulnerability patterns from SPG. We have extensively evaluated VulSPG on two large-scale datasets with programs from SARD and real-world projects. Experimental results prove the effectiveness and efficiency of VulSPG.
Motivation & Objective
- To address the challenge of detecting vulnerabilities in large, complex codebases where redundant information hinders model performance.
- To improve vulnerability detection by creating a more focused, semantically rich code representation that retains only vulnerability-relevant features.
- To enhance feature learning in graph-based models by incorporating a triple attention mechanism that emphasizes vulnerability patterns and suppresses noise.
- To evaluate the proposed method on large-scale, real-world datasets to validate its effectiveness and superiority over existing approaches.
Proposed method
- The paper introduces Slice Property Graph (SPG), a graph representation derived from program property graphs (CPG) that integrates data, control, and function call dependencies among slice nodes.
- SPG is constructed using six types of Syntax-based Vulnerability Candidates (SyVCs), including two newly proposed SyVCs to improve vulnerability coverage.
- The method employs an improved relational graph convolutional network (R-GCN) with a triple attention mechanism—token-level, node-level, and subgraph-level attention—to focus on vulnerability-relevant features.
- The attention mechanism dynamically assigns weights to nodes and edges in SPG, enabling the model to suppress irrelevant information and emphasize patterns indicative of vulnerabilities.
- The model is trained end-to-end on SPG representations to classify code segments as vulnerable or non-vulnerable.
Experimental results
Research questions
- RQ1Can a graph-based code representation that preserves only vulnerability-relevant structural and semantic information improve detection performance?
- RQ2How effective is the triple attention mechanism in enhancing feature learning for vulnerability detection in SPG?
- RQ3Does VulSPG outperform existing state-of-the-art methods on real-world and large-scale datasets?
- RQ4To what extent does the inclusion of additional SyVCs improve vulnerability coverage in program slicing?
Key findings
- VulSPG achieves superior performance compared to state-of-the-art methods on both the SARD-based slice-level dataset and real-world function-level datasets.
- The proposed SPG representation significantly reduces graph complexity by eliminating irrelevant code, leading to more efficient and accurate learning.
- The triple attention mechanism enhances model performance by focusing on critical vulnerability patterns and suppressing noise in the graph.
- The model maintains strong performance even without inter-procedural analysis, indicating robustness to incomplete program context.
- The experimental results confirm that the inclusion of two new SyVCs increases the coverage of vulnerable code segments in slicing.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.