Return
CodeGraphNet: embedding-driven enhanced vulnerability detection with line-level error identification
DOI:10.1007/s11219-026-09752-9.png)
Abstract
En 中文
Software vulnerabilities are defects in programs that adversaries can exploit to gain unauthorized access, alter execution, or leak sensitive information. Although many automated vulnerability detection approaches have been proposed, a persistent limitation is the quality of feature embeddings: token-only representations often miss deeper program semantics, while single-modality graph features may fail to capture complementary structural signals needed for reliable multi-class prediction. To address these gaps, we propose CodeGraphNet, a hierarchical graph-fusion embedding framework for function-level vulnerability detection in C/C++ code. CodeGraphNet jointly models inter-procedural control flow and function-call connectivity, data dependencies, and execution context through complementary graph views, and integrates them with transformer-based sequential representations via an adaptive fusion mechanism. We evaluate the framework using 10-fold cross-validation and an independent held-out test set, training multiple classifiers and an ensemble model (DeepTree). Compared with traditional embedding baselines, CodeGraphNet improves function-level vulnerability identification and achieves 0.767 accuracy and 0.769 F1-score on the test set. Relative to CodeBERT and GraphCodeBERT baselines with a 1-layer neural classifier, our approach yields improvements of up to 31.0% in accuracy and 49.4% in F1-score under the same evaluation setting. Finally, we integrate LIME to highlight influential tokens that drive predictions, providing actionable evidence for developer triage. Overall, the results suggest that fusing complementary program-structure graphs with sequential modeling improves both detection performance and interpretability, supporting more reliable vulnerability analysis in secure software development.
Keywords:
CWE
Software development
Hierarchical graph
Software vulnerabilities
Security protective
Defect localization
Journal
S
IF:
2.3
Papers:
30
Citations:
918

