1. Introduction
With the widespread adoption of open-source reuse, component-based development, and continuous integration, modern software systems increasingly depend on third-party libraries and external components. This trend improves development efficiency but also expands the attack surface of software systems. Vulnerabilities may exist not only in application code but also in dependent components, build scripts, and software supply chains, making vulnerability mining an important task for software security assurance [
1,
2,
3].
Traditional vulnerability mining methods mainly rely on rule matching, program slicing, symbolic execution, fuzzing, and static analysis. These methods have clear analytical procedures and are still widely used in practice. However, they often depend on expert-defined rules, precise program analysis, or carefully designed test inputs. In large and complex software systems, such methods may suffer from high false-positive rates, incomplete path coverage, imprecise call graph construction, and limited scalability [
4,
5,
6,
7,
8,
9,
10,
11]. Therefore, learning-based vulnerability mining has attracted increasing attention in recent years.
Programs contain rich structural information. Abstract syntax trees, control-flow graphs, data-flow graphs, program-dependence graphs, and code property graphs can describe source code from different perspectives, including syntactic organization, execution paths, data dependencies, and semantic relations [
12,
13,
14,
15]. Compared with purely sequence-based representations, graph-based representations are better suited to modeling cross-statement dependencies and structural propagation patterns. Based on these representations, graph neural networks (GNNs) have been widely applied to vulnerability detection, localization, explanation, smart contract analysis, and graph-enhanced code reasoning [
16,
17,
18,
19].
Although GNN-based methods have achieved promising results on public benchmarks, quantitative evidence indicates that commonly used evaluation settings may substantially overestimate practical vulnerability-detection capability. Chakraborty et al. reported that existing datasets contained up to 68% duplicated samples and that model performance dropped by more than 50% under a more realistic evaluation setting [
20]. A subsequent survey of 81 recent ML-based vulnerability-detection studies found that 88% formulated the task as function-level binary classification [
21]. In a manual examination of 100 functions labeled as vulnerable from each of BigVul, Devign, and DiverseVul, only 39%, 47%, and 65%, respectively, were confirmed to contain the reported vulnerabilities. Moreover, all 151 confirmed vulnerable functions required information outside the isolated function for accurate identification. A classifier using only word-count features still achieved F1 scores of 0.86 on BigVul and 0.622 on Devign, indicating that high benchmark scores can be obtained from spurious dataset correlations without modeling program structure or vulnerability semantics [
21].
These findings motivate stricter benchmark construction and repository-level evaluation. ReposVul, for example, contains 6134 CVE entries covering 236 CWE types and 1491 projects, and preserves repository-, file-, function-, and line-level information to support analysis beyond isolated functions [
22]. Therefore, it is necessary to review not only existing GNN architectures but also the dataset assumptions, graph-construction fidelity, evaluation protocols, and contextual conditions under which their reported advantages remain valid.
This paper reviews graph neural networks for software vulnerability mining, covering source-code vulnerability detection, vulnerability localization, vulnerability explanation, smart contract analysis, and graph-enhanced code reasoning. Java and smart contracts are selected as two representative analytical cases rather than as the exclusive scope of the review.
Java represents general-purpose, object-oriented software systems in which vulnerability analysis is complicated by inheritance, dynamic dispatch, reflection, serialization, framework callbacks, and inter-procedural dependencies. These language and framework mechanisms can introduce missing call relations, imprecise dependency edges, and incomplete program contexts during static graph construction [
23,
24,
25,
26,
27]. Java therefore provides a representative setting for examining graph-construction fidelity and the capability boundaries of GNN-based vulnerability mining.
Smart contracts represent security-critical programs whose vulnerabilities are often associated with explicit control-flow, data-flow, call, transaction-state, and inter-contract relations. Reentrancy, access-control errors, unsafe external calls, and state-dependent execution paths make graph-based structural reasoning particularly relevant in this setting [
28,
29,
30,
31,
32]. Smart contracts therefore provide a complementary case for analyzing heterogeneous relations, graph-guided reasoning, and security-specific structural constraints.
Other programming languages, including C/C++, Python and JavaScript are also included when the corresponding studies contribute to the research questions of this review. Java and smart contracts are used as focused representative cases to support deeper analysis of two distinct scenarios: complex general-purpose software systems and blockchain-oriented security-critical programs. Binary-only vulnerability analysis, penetration testing, malware detection, and unrelated graph-learning applications are outside the scope unless they directly contribute to software vulnerability mining.
Several high-quality reviews have examined research directions closely related to software vulnerability mining. Ghaffarian and Shahriari surveyed machine-learning-based and data-mining-based techniques for software vulnerability analysis and discovery [
33]. Lin et al. subsequently reviewed deep neural network-based vulnerability detection methods, with particular attention to code representations, neural architectures, datasets, and evaluation settings [
34]. More recently, Shiri Harzevili et al. conducted a systematic literature review of automated software vulnerability detection using machine learning and organized the field according to data sources, input representations, learning models, and detection tasks [
35]. Chu et al. reviewed smart contract vulnerabilities from the perspectives of vulnerability data sources, detection techniques, and repair methods [
36]. Sheng et al. further examined the application of large language models to software vulnerability detection, including model selection, application strategies, datasets, and evaluation metrics [
37].
These reviews provide valuable taxonomies of machine-learning models, deep neural networks, source-code representations, smart contract security techniques, and LLM-based vulnerability detection. However, their analytical scopes are primarily organized around individual model families or application domains. They provide limited joint analysis of how dataset construction, program graph fidelity, homogeneous and heterogeneous graph architectures, Graph–LLM integration, evaluation protocols, explanation verifiability, and deployment costs interact throughout the complete vulnerability-mining pipeline. In particular, the propagation of errors from duplicated or weakly labeled datasets and incomplete program graphs to unreliable predictions and unverifiable analyst-facing evidence has not been systematically synthesized across homogeneous GNNs, heterogeneous GNNs, and Graph–LLM systems.
To address this gap, this review adopts a pipeline-oriented analytical framework that connects dataset construction, program graph representation, model learning, evaluation reliability, and analyst-facing evidence. Rather than ranking models only according to benchmark accuracy, the review examines the conditions under which graph-based methods provide reliable structural advantages, the circumstances in which their reported gains may be affected by leakage or graph-construction errors, and the evidence required for practical vulnerability localization, explanation, and repair.
The contributions of this review are summarized as follows.
First, it provides a research-question-guided synthesis of program graph representations and node or edge features used in software vulnerability mining, including ASTs, CFGs, DFGs, PDGs, CPGs, multi-view graphs, and heterogeneous program graphs.
Second, it comparatively analyzes homogeneous GNNs, heterogeneous GNNs, semantic-enhanced graph learning, and Graph–LLM integration from the perspectives of structural expressiveness, capability boundaries, computational cost, task granularity, and applicable security scenarios.
Third, it introduces a pipeline-oriented reliability analysis that connects dataset quality, graph-construction fidelity, model design, evaluation protocol, generalization setting, explanation validity, and deployment evidence. This analysis highlights how early-stage data or graph errors may propagate to downstream detection and explanation results.
Fourth, it consolidates minimum requirements for reliable vulnerability benchmarks and verifiable explanations, and develops a strategic research agenda covering leakage-resistant datasets, high-fidelity program graphs, repository-level evaluation, cost-effective Graph–LLM integration, and graph-guided autonomous vulnerability repair.
The remainder of this paper is organized as follows.
Section 2 presents the review methodology, including the research questions, search strategy, eligibility criteria, study-selection process, data extraction, quality assessment, and synthesis strategy.
Section 3 reviews program graph modeling and node representation methods.
Section 4 and
Section 5 discuss homogeneous and heterogeneous GNN-based vulnerability mining methods, respectively.
Section 6 analyzes Graph–LLM integration for vulnerability mining.
Section 7 provides a cross-paradigm discussion and strategic research agenda, focusing on benchmark reliability, graph-construction fidelity, explanation validity, applicability boundaries, and future research directions.
Section 8 concludes the paper.
2. Review Methodology
2.3. Information Sources and Search-Term Development
The literature coverage spans publications from 2014 to July 2026. During the revision stage, the literature set was updated to incorporate newly available studies relevant to the defined research questions. The year 2014 was selected as the starting point because research on code property graphs provided an important foundation for graph-based software vulnerability analysis. The information sources included IEEE Xplore, ACM Digital Library, ScienceDirect, SpringerLink, and arXiv. Backward and forward snowballing was also conducted to identify relevant studies that were not retrieved through database searches alone.
The search terms were developed through a four-step process. First, representative seed studies on program graphs, graph neural networks, and software vulnerability detection were examined to identify commonly used terminology. Second, the identified terms were organized into four concept groups: graph learning, program representation, vulnerability analysis, and semantic-enhanced modeling. Third, pilot searches were conducted in the selected databases, and the search expressions were iteratively refined by adding synonyms, abbreviations, model names, and task-specific terms found in relevant records. Fourth, backward and forward snowballing was applied to the included seed studies and subsequently selected papers to identify additional terminology and relevant publications. This process was used to reduce dependence on subjective keyword selection and improve search coverage.
The graph-learning concept group included terms such as “graph neural network”, GNN, GCN, GGNN, GAT, HGT, “heterogeneous graph”, and “relational graph neural network”. The program-representation group included “program graph”, “code property graph”, AST, CFG, DFG, PDG, call graph, program slice, and heterogeneous program graph. The vulnerability-analysis group included “vulnerability detection”, “vulnerability mining”, “software vulnerability”, “vulnerability localization”, “vulnerability explanation”, and “smart contract vulnerability”. To cover semantic-enhanced and emerging approaches, additional terms included “pretrained code model”, CodeBERT, GraphCodeBERT, CodeT5, “large language model”, LLM, Graph–LLM, graph retrieval, and neuro-symbolic reasoning.
The main search expression was constructed by combining at least one term from the graph-learning group, one term from the vulnerability-analysis group, and, where applicable, one term from the program-representation group. A representative search expression was:
(“graph neural network” OR GNN OR GCN OR GGNN OR GAT OR HGT OR “heterogeneous graph”) AND (“vulnerability detection” OR “vulnerability mining” OR “software vulnerability” OR “vulnerability localization” OR “smart contract vulnerability”) AND (“program graph” OR “code property graph” OR AST OR CFG OR DFG OR PDG).
For Graph–LLM and pretrained-code-model studies, supplementary searches combined semantic-model terms with vulnerability-analysis terms, for example:
(“large language model” OR LLM OR “pretrained code model” OR CodeBERT OR GraphCodeBERT OR CodeT5) AND (“vulnerability detection” OR “software security” OR “program analysis”).
All retrieved records were subsequently screened according to their relevance to graph-based software vulnerability mining, program graph construction, graph neural network modeling, evaluation reliability, and explanation-oriented vulnerability analysis.
2.8. Synthesis Strategy and Mapping to Research Questions
Because the included studies differ substantially in programming languages, vulnerability types, datasets, graph representations, model architectures, evaluation metrics, and task granularities, their reported results were not suitable for direct statistical pooling. The evidence was therefore synthesized through a research-question-guided thematic analysis and a pipeline-oriented comparison.
For RQ1, the included studies were grouped according to program graph representation, graph-construction process, and node or edge features. The synthesis compared ASTs, CFGs, DFGs, PDGs, CPGs, multi-view graphs, and heterogeneous program graphs in terms of the vulnerability-relevant information they preserve and the limitations introduced during graph construction.
For RQ2, the studies were organized according to homogeneous and heterogeneous GNN paradigms. Homogeneous methods were compared in terms of neighborhood aggregation, gated propagation, attention mechanisms, and capability boundaries. Heterogeneous methods were compared according to metapath-based modeling, relation-specific propagation, type-aware attention, graph-quality requirements, and computational complexity.
For RQ3, Graph–LLM studies were synthesized according to three integration routes: graph-enhanced large language models, LLM-enhanced graph learning, and graph-guided or neuro-symbolic reasoning. The comparison considered semantic and structural complementarity, computational cost, inference latency, verification requirements, and applicability to detection, localization, explanation, and repair.
For RQ4, the evidence was analyzed across dataset quality, graph-construction fidelity, evaluation protocol, cross-project generalization, explanation validity, and deployment evidence. Particular attention was paid to whether reported performance could be affected by duplicated samples, random data splits, temporal leakage, noisy labels, incomplete program context, or unverifiable explanations.
For RQ5, recurring limitations and proposed solutions were consolidated into a strategic research agenda covering leakage-resistant benchmarks, high-fidelity graph construction, verifiable explanations, repository-level analysis, cost-effective Graph–LLM integration, and graph-guided autonomous vulnerability repair.
This synthesis strategy enables the review to compare studies beyond model accuracy and to examine how dataset construction, program representation, learning architecture, evaluation design, and analyst-facing evidence jointly affect the reliability and practical value of graph-based vulnerability mining.
Based on the screened literature, structured coding framework, and research-question-guided synthesis,
Figure 1 summarizes the technical evolution identified in this review. The framework reflects the transition from rule-based static analysis and explicit program graph construction to homogeneous GNNs, heterogeneous graph learning, and Graph–LLM integration. It was derived after the study-selection and thematic-coding processes rather than being predefined before the review.
2.9. Review Limitations
This review has several methodological limitations. First, although multiple academic databases and backward and forward snowballing were used, some relevant studies may not have been retrieved because of differences in indexing, terminology, publication venue, or database coverage. The search primarily focused on English-language and publicly accessible publications, which may introduce language and availability bias.
Second, the included studies differ substantially in programming languages, vulnerability categories, graph representations, datasets, task granularities, evaluation metrics, and experimental protocols. This heterogeneity prevented meaningful quantitative meta-analysis and required a qualitative thematic synthesis. Consequently, direct numerical comparisons across studies should be interpreted cautiously.
Third, peer-reviewed journal and conference papers were prioritized, but a limited number of preprints and technical reports were retained to represent rapidly emerging topics such as Graph–LLM integration, neuro-symbolic reasoning, and agent-based vulnerability repair. These sources were used mainly to identify recent trends and were not treated as equivalent to peer-reviewed empirical evidence.
Fourth, the quality appraisal relied on the methodological information reported in the original publications. Incomplete reporting may therefore affect the accuracy of the appraisal. Because formal numerical scores or study-level categorical rankings were not assigned, the appraisal was used only to guide cautious interpretation and evidence weighting.
In addition, exact numerical records for every intermediate screening and exclusion stage were not retained because the review protocol was retrospectively formalized as PRISMA-informed. Therefore, the review reports the initial approximate retrieval scale and final included corpus without reconstructing unverifiable intermediate counts.
To reduce these limitations, the review combined multiple information sources, explicit eligibility criteria, snowballing, structured coding dimensions, full-text verification, and cautious interpretation of studies with incomplete reporting or elevated risk of bias. Nevertheless, the conclusions should be understood as a structured synthesis of the available evidence rather than as an exhaustive or statistically pooled estimate of model effectiveness.
6. Graph–LLM Integration for Vulnerability Mining
The integration of graph-based methods and large language models (LLMs) has recently become an emerging direction in software vulnerability mining. The motivation is not that LLMs can simply replace program graphs or GNNs, but that graphs and LLMs provide complementary types of information. Program graphs can provide explicit structural evidence, such as control flow, data flow, call relations, and dependency paths, while LLMs can provide broader semantic representations, contextual understanding, and natural-language reasoning capabilities. Graph–LLM integration is therefore better understood as an attempt to combine structural constraints with semantic reasoning.
Current studies can be broadly divided into three integration routes: graph-enhanced LLMs, LLM-enhanced graph learning, and graph-guided or neuro-symbolic reasoning.
6.4. Cost–Benefit and Deployment Analysis
Graph–LLM integration can improve semantic understanding, contextual reasoning, explanation generation, and repair-oriented analysis, but these benefits should be evaluated together with their computational and engineering costs. Compared with graph-only GNNs, hybrid systems usually require larger pretrained models, additional graph-to-text or graph-to-embedding interfaces, more GPU memory, longer inference time, and more complex deployment pipelines.
Graph-only GNNs remain suitable for large-scale vulnerability screening when program graphs can capture the relevant structural evidence and when low inference latency, stable resource consumption, and reproducible deployment are important. Their main advantages include relatively compact model size, efficient batch processing, explicit structural inductive bias, and easier integration into continuous-integration or static-analysis pipelines. However, their semantic reasoning ability may be limited when vulnerabilities depend on long-range repository context, configuration semantics, natural-language specifications, or complex business logic.
Graph–LLM hybrid methods are more suitable for scenarios that require broader semantic context, natural-language explanations, repository-level reasoning, interactive security analysis, or patch generation. In these settings, program graphs can provide structural constraints and retrieval targets, while LLMs can support semantic interpretation and multi-step reasoning. Nevertheless, the resulting performance gains may not justify the additional cost for routine function-level classification or high-throughput code scanning.
Future studies should therefore report not only predictive performance but also model size, training resources, peak memory usage, inference latency, throughput, energy consumption, and deployment complexity. Comparisons should include graph-only baselines and determine whether the additional semantic capability produces meaningful improvements under realistic security workloads.
A practical deployment strategy may adopt a staged architecture. A lightweight graph-based detector can first perform large-scale screening, after which a Graph–LLM system is selectively applied to high-risk samples for explanation, repository-level investigation, or repair recommendation. Such selective invocation can reduce computational cost while preserving the semantic-reasoning advantages of hybrid models.
Overall, Graph–LLM integration remains an emerging vulnerability-mining paradigm. Its value should not be assessed only by whether it combines larger models with richer graphs, but by whether it provides measurable improvements in detection, localization, explanation, or repair under realistic resource constraints. Reliable Graph–LLM systems should preserve structural grounding, report computational costs, control data leakage, and provide verifiable evidence that can be inspected by security analysts.
7. Cross-Paradigm Discussion and Research Agenda
Existing studies show that GNN-based methods are useful when vulnerability-relevant structures can be explicitly represented in program graphs, such as control flow, data flow, call relations, def–use chains, and smart contract execution logic [
16,
18,
54,
75]. However, their reported advantages are strongly affected by dataset quality, graph construction fidelity, evaluation protocols, task granularity, and deployment requirements. Therefore, the key question is not whether graph-based models are useful, but under what conditions their advantages are reliable, explainable, and practically meaningful.
7.1. From Vulnerability Mining Pipeline to Research Problems
GNN-based vulnerability mining should not be understood only as a comparison among model architectures. A practical vulnerability mining pipeline usually involves dataset construction, program representation, model learning, evaluation protocol, and deployment evidence. Each stage introduces different research problems and may limit the effectiveness of later stages. From this perspective, existing graph-based studies should be analyzed not only by what model they use, but also by what part of the vulnerability mining pipeline they improve and what problems they leave unresolved.
First, dataset construction determines whether models learn real vulnerability mechanisms or benchmark-specific artifacts. Noisy labels, duplicated functions, simplified synthetic samples, and random splits may cause overly optimistic results. Therefore, future datasets should emphasize stricter deduplication, clearer vulnerability labels, and more realistic project-level or repository-level contexts. Second, program representation determines what information is available to the model. ASTs, CFGs, PDGs, CPGs, multi-view graphs, and heterogeneous graphs provide different structural views, but their usefulness depends on whether they preserve vulnerability-relevant control-flow, data-flow, call, and type relations.
Third, model learning determines how structural and semantic information is aggregated. Homogeneous GNNs can introduce structural message passing, but they may mix different program relations in a unified representation space. Heterogeneous GNNs can model relation types more explicitly, but they depend on accurate relation typing and sufficient labeled data. Graph–LLM methods may support semantic reasoning, but their outputs still require graph grounding and evidence verification. Fourth, evaluation determines whether reported performance reflects practical vulnerability mining ability. Function-level random splits are insufficient for assessing cross-project, temporal, cross-dataset, repository-level, or real-world generalization.
Finally, deployment requires actionable evidence rather than only prediction scores. Attention weights, heat maps, and node-importance rankings are not equivalent to verifiable vulnerability evidence. Practical vulnerability mining systems should provide vulnerable lines, dependency paths, patches, static-analysis reports, or other evidence that can support localization, triage, and repair. This pipeline-based view clarifies why many current studies show promising benchmark results but remain difficult to apply in realistic security scenarios. The bottleneck of GNN-based vulnerability mining is not only model expressiveness, but also the alignment among data quality, graph fidelity, task granularity, evaluation protocol, and analyst-facing evidence.
7.5. Strategic Future Research Agenda
Future research should move beyond incremental model optimization and address the complete vulnerability-mining pipeline.
Table 7 summarizes five strategic directions, their technical objectives, and the evidence required to demonstrate practical progress.
First, benchmark development should shift from isolated function-level samples toward repository-level and temporally ordered datasets. Future benchmarks should preserve cross-function, cross-file, dependency, configuration, and build-system contexts while providing transparent deduplication and labeling procedures. Evaluation should include project-level, temporal, cross-version, and cross-dataset settings so that reported improvements can be distinguished from benchmark-specific memorization.
Second, program graph construction should become uncertainty-aware. Existing static analysis tools may omit or incorrectly construct call, data-flow, and dependency relations in the presence of reflection, dynamic dispatch, serialization, framework callbacks, and runtime binding. Future systems should combine static graphs with dynamic traces, points-to analysis, type inference, multi-view representations, and learned edge prediction. Graph-construction uncertainty should also be propagated to downstream models rather than treating every node and edge as equally reliable.
Third, explanation research should focus on analyst-facing and verifiable evidence. Future methods should jointly evaluate counterfactual faithfulness, stability, localization accuracy, path consistency, agreement with security reports, and human usability. Explanations should be connected to source-code lines, dependency paths, program slices, patches, and reproducible analysis logs so that security analysts can inspect how a prediction was produced.
Fourth, Graph–LLM integration should be evaluated according to task-specific cost and benefit. Hybrid systems are likely to be most useful for repository-level investigation, vulnerability explanation, interactive analysis, and repair recommendation, whereas graph-only models may remain more appropriate for large-scale screening. Staged systems that first use lightweight graph models and then invoke LLM-based reasoning for high-risk samples may provide a practical balance between throughput and semantic capability.
Finally, graph-guided autonomous agents represent a promising direction for moving from vulnerability detection to vulnerability repair. Such agents may combine suspicious-code retrieval, graph-based path analysis, static-analysis rules, LLM reasoning, patch generation, test execution, and iterative verification [
91,
92,
95,
96]. Program graphs can constrain the agent by identifying affected variables, dependency paths, call relations, and security-sensitive statements, while verification tools can test whether a generated patch removes the vulnerability without introducing functional regressions.
The success of autonomous repair systems should not be measured only by the number of generated patches. Evaluation should determine whether patches compile, pass functional and security tests, preserve intended behavior, remove the original vulnerability, and avoid introducing new defects. Human review should remain part of the deployment process for high-risk software until automated verification becomes sufficiently reliable.
Overall, future progress will depend on coordinated improvements in datasets, graph construction, model design, evaluation, explanation, and repair. The field should therefore move from isolated benchmark optimization toward evidence-grounded systems that can support reliable vulnerability detection, localization, explanation, and remediation in realistic software repositories.
8. Conclusions
This review examined graph neural networks for software vulnerability mining through five research questions covering program graph representation, homogeneous and heterogeneous GNN architectures, Graph–LLM integration, evaluation reliability, and future research directions. The reviewed evidence shows that program graphs can provide useful structural information for vulnerability detection, localization, explanation, and repair, particularly when vulnerabilities are associated with explicit syntax, control-flow, data-flow, call, or dependency relations.
The effectiveness of graph-based vulnerability mining nevertheless depends strongly on the fidelity of the underlying program representation. Homogeneous GNNs provide efficient structural message passing but may mix different semantic relations, whereas heterogeneous GNNs preserve relation types more explicitly at the cost of greater graph-quality, data, and computational requirements. Graph–LLM systems can further improve semantic reasoning, repository-level analysis, explanation generation, and repair support, but their benefits should be assessed together with model size, memory consumption, inference latency, deployment complexity, and evidence-verification requirements.
The review also indicates that high benchmark performance does not necessarily imply reliable practical capability. Duplicated samples, random function-level splits, noisy labels, temporal leakage, incomplete repository context, and unverifiable explanations may substantially inflate reported results. Reliable future studies should therefore adopt leakage-resistant benchmarks, project-level and temporal evaluation, transparent graph-construction procedures, reproducible split metadata, and explanation protocols based on counterfactual faithfulness, stability, code-level localization, and agreement with independent security evidence.
Future progress should move from isolated model optimization toward pipeline-oriented and evidence-grounded vulnerability analysis. Promising directions include uncertainty-aware graph construction, repository-level evaluation, cost-effective Graph–LLM collaboration, analyst-facing explanations, and graph-guided autonomous agents that integrate vulnerability localization, patch generation, testing, and verification. Overall, graph-based vulnerability mining will become practically valuable only when improvements in data quality, graph fidelity, model design, evaluation rigor, and actionable security evidence are developed together.