MDFVD: vulnerability detection via multi-dimensional-feature-based code representation
摘要
Code vulnerabilities pose a critical security threat, with potential consequences such as data breaches in e-government systems, risking societal stability and national security. While deep learning (DL)-based methods have advanced vulnerability detection by leveraging graph neural networks (GNNs), existing approaches often neglect local semantic details and underutilize diverse edge types in code structure graphs. To address these limitations, this study aims to develop a comprehensive vulnerability detection framework that integrates both local and global semantic information. We propose MDFVD (Multi-Dimensional-Feature-based Vulnerability Detection), which introduces two key innovations: a Multi-dimensional node Feature extraction strategy (MFES) combined with Attention-based Bidirectional Gated Recurrent Unit (ABiGRU) to capture fine-grained local semantic features, and an Attention Mechanism and Multi-layer Feature Fusion-based Relational GCN (AMF-RGCN) to model diverse edge relationships for enhanced global structural learning. Additionally, we design a novel Combination Code Property Graph (ComCPG) that enriches syntactic and contextual information to better represent source code structure. Extensive experiments on four benchmark datasets validate MDFVD’s effectiveness. Compared to state-of-the-art baselines, MDFVD achieves F1-score improvements of 15.15%, 21.25%, 9.37% and 14.67% across datasets. These results demonstrate that integrating MFES for local semantics and AMF-RGCN for structural edge utilization, alongside ComCPG, enables more robust vulnerability detection.