ORACAL: A Robust and Explainable Multimodal Framework for Smart Contract Vulnerability Detection with Causal Graph Enrichment
Organizations: Information Security Lab, University of Information Technology, Ho Chi Minh City, Vietnam · Vietnam National University, Ho Chi Minh City, Vietnam · School of Computer Science and Information Technology, Adelaide University, Adelaide, Australia
Abstract
Although Graph Neural Networks (GNNs) have shown promise for smart contract vulnerability detection, they still face significant limitations. Homogeneous graph models fail to capture the interplay between control flow and data dependencies, while heterogeneous graph approaches often lack deep semantic understanding, leaving them susceptible to adversarial attacks. Moreover, most black-box models fail to provide explainable evidence, hindering trust in professional audits. To address these challenges, we propose ORACAL (Observable RAG-enhanced Analysis with CausAL reasoning), a heterogeneous multimodal graph learning framework that integrates Control Flow Graph (CFG), Data Flow Graph (DFG), and Call Graph (CG). ORACAL selectively enriches critical subgraphs with expert-level security context from Retrieval-Augmented Generation (RAG) and Large Language Models (LLMs), and employs a causal attention mechanism to disentangle true vulnerability indicators from spurious correlations. For transparency, the framework adopts PGExplainer to generate subgraph-level explanations identifying vulnerability triggering paths. Experiments on large-scale datasets demonstrate that ORACAL achieves state-of-the-art performance, outperforming MANDO-HGT, MTVHunter, GNN-SC, and SCVHunter by up to 39.6 percentage points, with a peak Macro F1 of 91.28% on the primary benchmark. ORACAL maintains strong generalization on out-of-distribution datasets with 91.8% on CGT Weakness and 77.1% on DAppScan. In explainability evaluation, PGExplainer achieves 32.51% Mean Intersection over Union (MIoU) against manually annotated vulnerability triggering paths. Under adversarial attacks, ORACAL limits performance degradation to approximately 2.35% F1 decrease with an Attack Success Rate (ASR) of only 3%, surpassing SCVHunter and MANDO-HGT which exhibit ASRs ranging from 10.91% to 18.73%.
Figures & tables
| Method | Year | Category | Technique | Semantic | Explainability |
| Oyente [ 27 ] | 2016 | Static Analysis | Symbolic Execution | No | Yes |
| Slither [ 28 ] | 2018 | Static Analysis | Rule-based | No | Yes |
| Peculiar [ 29 ] | 2019 | Deep Learning | Homogeneous Graph | No | No |
| GNN-SC [ 30 ] | 2021 | Deep Learning | Homogeneous Graph | No | No |
| MANDO-HGT [ 31 ] | 2023 | Deep Learning | Heterogeneous Graph | No | No |
| SCVHunter [ 11 ] | 2024 | Deep Learning | Heterogeneous Graph | No | No |
| Vulnerability Type | SoliAudit | CGT Weakness | DAppScan | LLMAV | ||||
| Pos. | Neg. | Pos. | Neg. | Pos. | Neg. | Pos. | Neg. | |
| Arithmetic | 9,849 | 806 | 530 | 815 | 20 | 104 | 472 | 557 |
| Low-Level Calls | 3,109 | 7,546 | 801 | 544 | 3 | 121 | 68 | 961 |
| Denial of Service | 4,657 | 5,998 | 776 | 569 | 10 | 114 | 119 | 910 |
| Time Manipulation | 3,420 | 7,235 | 845 | 500 | 7 | 117 | 415 | 614 |
| Total Samples | 10,655 | 1,345 | 124 | 1,029 | ||||
| Dataset | Vulnerability | Train | Test | Total |
| SoliAudit | Arithmetic | 7,879 | 1,970 | 9,849 |
| Low Level Calls | 2,487 | 622 | 3,109 | |
| Denial of Services | 3,726 | 931 | 4,657 | |
| Time Manipulation | 2,736 | 684 | 3,420 | |
| CGTWeakness | Arithmetic | 424 | 106 | 530 |
| Low Level Calls | 641 | 160 | 801 |
| Parameter Type | Parameter | Value |
| Training | Epochs | 50 |
| Learning Rate | 2e-4 | |
| Batch Size | 64 | |
| Optimizer | AdamW | |
| Weight Decay | 0.0001 | |
| Dropout Rate | 0.2 |
| Training Type | Scenario | Accuracy (%) | F1-Macro (%) | Precision (%) | Recall (%) |
| Standard | No enrichment (baseline) | 82.84 | 86.94 | 90.36 | 84.05 |
| Only edge enrichment | 82.85 | 87.19 | 89.94 | 84.79 | |
| All node + edge enrichment | 82.62 | 86.93 | 89.03 | 85.11 | |
| All node enrichment | 82.02 | 86.74 | 88.37 | 85.29 | |
| Only enrichment text | 72.63 | 72.21 | 79.38 | 67.92 | |
| Only Operational Context | 82.90 | 87.14 | 90.32 | 84.35 |
| Dataset | Vulnerability Class | ORACAL-edge Causal | ORACAL-edge Standard | ORACAL-node-edge Causal | ORACAL-node-edge Standard |
| (Mean Std Dev) | (Mean Std Dev) | (Mean Std Dev) | (Mean Std Dev) | ||
| CGT | Arithmetic | 0.982 0.004 | 0.967 0.004 | 0.976 0.005 | 0.959 0.006 |
| LowLevelCalls | 0.877 0.015 | 0.836 0.017 | 0.869 0.017 | 0.827 0.019 | |
| DenialOfService | 0.882 0.013 | 0.844 0.018 | 0.874 0.015 | 0.835 0.020 | |
| TimeManipulation | 0.921 0.010 | 0.883 0.019 | 0.912 0.012 | 0.874 0.021 | |
| Overall (Macro F1) | 0.918 0.004 | 0.883 0.006 | 0.908 0.006 | 0.874 0.008 |
| Dataset | Explainer | MSP(%) | MSR(%) | MIoU(%) |
| LLMAV [ 26 ] | GNNExplainer | 35.86 | 39.72 | 27.96 |
| PGExplainer | 40.91 | 44.85 | 32.51 | |
| AttentionExplainer | 27.94 | 31.62 | 19.17 | |
| DAppScan [ 25 ] | GNNExplainer | 33.74 | 37.91 | 26.05 |
| PGExplainer | 39.68 | 42.77 | 30.85 | |
| AttentionExplainer | 25.81 | 29.47 | 17.08 |
| Model | Method | SoliAudit | CGTWeakness | DAppScan | |||
| F1(%) | ASR(%) | F1(%) | ASR(%) | F1(%) | ASR(%) | ||
| GNN-SC | Original | 70.74 | - | 70.20 | - | 66.47 | - |
| HSAttack | 61.92(-8.82) | 11.04 | 61.07(-9.13) | 11.62 | 57.90(-8.57) | 10.31 | |
| MTVHunter | Original | 78.10 | - | 78.73 | - | 58.94 | - |
| HSAttack | 69.65(-8.45) | 10.91 | 69.82(-8.91) | 11.47 | 51.92(-7.02) | 9.73 | |
| SCVHunter | Original | 51.62 | - | 50.20 | - | 28.44 | - |
Software Vulnerability Detection
Software vulnerability detection identifies insecure code, pinpoints weaknesses, and helps developers validate or prevent exploitable bugs.
See all 139 papers