GraphCodeBERT-Augmented Graph Attention Networks for Code Vulnerability Detection
Detecting software vulnerabilities is critical for the security of modern complex software systems. However, it is challenging due to the complexity of codebases and limitations in existing methods. Traditional approaches often struggle to capture both semantic and structural dependencies effectively. To represent code semantics comprehensively, this paper presents a novel framework integrating Graph Attention Networks (GATs) with Code Property Graphs (CPGs), which unify Abstract Syntax Trees (ASTs), Control Flow Graphs (CFGs), and Program Dependency Graphs (PDGs). Node embeddings are initialized using pretrained GraphCodeBERT, enhanced with multi-head attention layers, residual connections, and global attention pooling. GANbased data augmentation is employed to address the class imbalance, improving model robustness. Our extensive experimental evaluations demonstrate a detection accuracy of 88.5 percent, surpassing state-of-the-art baselines such as CodeBERT and GraphCodeBERT across multiple evaluation metrics, including precision, recall, and F1-score. Furthermore, interpretable attention mechanisms enable the prioritization of critical code regions, ensuring practical applicability. This work establishes a scalable and explainable AI-driven approach for vulnerability detection.
Authors
- Nalini Ratha (ORCID: https://orcid.org/0000-0001-7913-5722)
- Deekshith Sagar Rangapuram
Institutions
- University at Buffalo, State University of New York (US)
Publication Details
- Published
- 2025-05-05
- DOI
- https://doi.org/10.1109/cai64502.2025.00161
- Primary Topic
- Software Reliability and Analysis Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00