Contract-Graph Fusion and Cross-Graph Matching for Smart-Contract Vulnerability Detection
Source abstract
Abstract
Smart contracts empower many blockchain applications but are exposed to code-level defects. Existing methods do not scale to the evolving code, do not represent complex control and data flows, and lack granular and calibrated evidence. To address the above concerns, we present an across-graph corresponding contract-graph method for vulnerability detection: abstract syntax, control flow, and data flow are fused into a typed, directed contract-graph whose nodes are enriched with pre-code embeddings (GraphCodeBERT or CodeT5+). A Graph Matching Network (GMN) with cross-graph attention compares contract-graphs, aligns homologous sub-graphs associated with vulnerabilities, and supports the interpretation of statements at the level of balance between a broad structural coverage and a discriminative pairwise alignment. The evaluation follows a deployment-oriented protocol with thresholds fixed for validation, multi-seed averaging, and a conservative estimate of sensitivity under low-false-positive budgets. On SmartBugs Wild, the method consistently and markedly exceeds strong rule-based and learning baselines and maintains a higher sensitivity to matching false-positive rates; ablations track the gains to multi-graph fusion, pre-trained encoders, and cross-graph matching, stable through seeds.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Blockchain Technology Applications and Security · Cybercrime and Law Enforcement Studies
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
School of Computer Science, China University of Geosciences, Wuhan 430074, China
School of Computing, Newcastle University, Urban Science Building, Newcastle upon Tyne NE4 5TG, UK
References (46)
Show source-provided references
1. Security threat mitigation for smart contracts: A comprehensive survey10.1145/3593293 ↗
2. Tsai, C.C., Lin, C.C., and Liao, S.W. (2023, January 17–21). Unveiling vulnerabilities in DAO: A comprehensive security analysis and protective framework. Proceedings of the 2023 IEEE International Conference on Blockchain (Blockchain 2023), Danzhou, China.10.1109/Blockchain60715.2023.00034 ↗
3. Blockchain for finance: A survey10.1049/blc2.12067 ↗
4. Survey of vulnerability detection and defense for Ethereum smart contracts
5. Vulnerability Detection via Multiple-Graph-Based Code Representation10.1109/TSE.2024.3427815 ↗
6. SmartGuard: An LLM-enhanced framework for smart contract vulnerability detection10.1016/j.eswa.2025.126479 ↗
7. Luo, F., Luo, R., Chen, T., Qiao, A., He, Z., Song, S., Jiang, Y., and Li, S. (2024, January 14–20). SCVHunter: Smart Contract Vulnerability Detection Based on Heterogeneous Graph Attention Network. Proceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering (ICSE 2024), Lisbon, Portugal.10.1145/3597503.3639213 ↗
8. Smart contract vulnerability detection based on semantic graph and residual graph convolutional networks with edge attention10.1016/j.jss.2023.111705 ↗
9. Wang, Y., Le, H., Gotmare, A.D., Bui, N.D., Li, J., and Hoi, S.C. (2023, January 6–10). CodeT5+: Open Code Large Language Models for Code Understanding and Generation. Proceedings of the 2023 Association for Computational Linguistics Conference on Empirical Methods in Natural Language Processing (EMNLP 2023), Singapore.10.18653/v1/2023.emnlp-main.68 ↗
10. Durieux, T., Ferreira, J.F., Abreu, R., and Cruz, P. (July, January 27). Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts. Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea.
11. LuaTaint: A Static Analysis System for Web Configuration Interface Vulnerability of Internet of Things Device10.1109/JIOT.2024.3490661 ↗
12. Li, Y., Ma, L., Shen, L., Lv, J., and Zhang, P. (2019). Open source software security vulnerability detection based on dynamic behavior features. PLoS ONE, 14.10.1371/journal.pone.0221530 ↗
13. Combine sliced joint graph with graph neural networks for smart contract vulnerability detection10.1016/j.jss.2022.111550 ↗
14. DA-GNN: A smart contract vulnerability detection method based on Dual Attention Graph Neural Network10.1016/j.comnet.2024.110238 ↗
15. Cao, S., Sun, X., Wu, X., Lo, D., Bo, L., Li, B., and Liu, W. (2024, January 14–20). Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systems. Proceedings of the 2024 IEEE/ACM International Conference on Software Engineering (ICSE 2024), Lisbon, Portugal.
16. Hussain, S., Nadeem, M., Baber, J., Hamdi, M., Rajab, A., Al Reshan, M.S., and Shaikh, A. (2024). Vulnerability detection in Java source code using a quantum convolutional neural network with self-attentive pooling, deep sequence, and graph-based hybrid feature extraction. Sci. Rep., 14.10.1038/s41598-024-56871-z ↗
17. Pitfalls in Machine Learning for Computer Security10.1145/3643456 ↗
18. A comprehensive analysis on software vulnerability detection datasets: Trends, challenges, and road ahead10.1007/s10207-024-00888-y ↗
19. Wang, H., Tang, Z., Tan, S.H., Wang, J., Liu, Y., Fang, H., Xia, C., and Wang, Z. (2024, January 14–20). Combining structured static code information and dynamic symbolic traces for software vulnerability prediction. Proceedings of the 46th International Conference on Software Engineering (ICSE 2024), Lisbon, Portugal.10.1145/3597503.3639212 ↗
20. A survey of Ethereum smart contract security: Attacks and detection10.1145/3643895 ↗
21. A survey on smart contract vulnerabilities: Data sources, detection and repair10.1016/j.infsof.2023.107221 ↗
22. Survey on quality assurance of smart contracts
23. Vulnerability detection techniques for smart contracts: A systematic literature review10.1016/j.jss.2024.112160 ↗
24. A comprehensive survey of smart contract security: State of the art and research directions10.1016/j.jnca.2024.103882 ↗
25. Sendner, C., Petzi, L., Stang, J., and Dmitrienko, A. (March, January 27). Smarter Contracts: Detecting vulnerabilities in smart contracts with deep transfer learning (ESCORT). Proceedings of the Network and Distributed System Security Symposium (NDSS 2023), San Diego, CA, USA.10.14722/ndss.2023.23263 ↗
26. Ruaro, N., Gritti, F., McLaughlin, R., Grishchenko, I., Kruegel, C., and Vigna, G. (March, January 26). Not your type! Detecting storage collision vulnerabilities in Ethereum smart contracts. Proceedings of the Network and Distributed System Security Symposium (NDSS 2024), San Diego, CA, USA.10.14722/ndss.2024.24713 ↗
27. Ferreira, J.F., Durieux, T., and Maranhao, R. (2025, August 26). SmartBugs Wild Dataset: 47,398 Smart Contracts from Ethereum. Dataset. Available online: https://github.com/smartbugs/smartbugs-wild.
28. Huang, Q., Zeng, Z., and Shang, Y. (2024, January 14–16). An empirical study of integer overflow detection and false positive analysis in smart contracts. Proceedings of the 8th ACM International Conference on Big Data and Internet of Things (BDIOT 2024), Macau, China.10.1145/3697355.3697396 ↗
29. HGAT: Smart contract vulnerability detection method based on hierarchical graph attention network10.1186/s13677-023-00459-x ↗
30. MVD-HG: Multigranularity smart contract vulnerability detection method based on heterogeneous graphs10.1186/s42400-024-00245-5 ↗
31. Feist, J., Grieco, G., and Groce, A. (2019, January 27). Slither: A static analysis framework for smart contracts. Proceedings of the 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Montreal, QC, Canada.10.1109/WETSEB.2019.00008 ↗
32. Consensys (2024, April 26). solc-typed-ast: A Typed Solidity AST Library, Version v18.1.4. GitHub Repository. Available online: https://github.com/ConsenSys/solc-typed-ast.
33. Guo, H., Yu, Y., and Li, X. (2020, January 24–28). ContractFuzzer: Fuzzing smart contracts for vulnerability detection. Proceedings of the 2020 IEEE International Conference on Software Testing, Verification and Validation (ICST), Porto, Portugal.
34. Hasan, M., Kumar, N., Majeed, A., Ahmad, A., and Mukhtar, S. (2023). Protein–Protein Interaction Network Analysis Using NetworkX. Protein–Protein Interactions: Methods and Protocols, Springer.10.1007/978-1-0716-3327-4_35 ↗
35. Nguyen, T.D., Pham, L.H., Sun, J., Lin, Y., and Minh, Q.T. (July, January 27). sFuzz: An efficient adaptive fuzzer for Solidity smart contracts. Proceedings of the 42nd ACM/IEEE International Conference on Software Engineering (ICSE 2020), Seoul, Republic of Korea.10.1145/3377811.3380334 ↗
36. Tikhomirov, S., Voskresenskaya, E., Ivanitskiy, I., Takhaviev, R., Marchenko, E., and Alexandrov, Y. (2018, January 25). SmartCheck: Static analysis of Ethereum smart contracts. Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Goteburg, Sweden.10.1145/3194113.3194115 ↗
37. Torres, C.F., Schütte, J., and State, R. (2018, January 3–7). Osiris: Hunting for Integer Bugs in Ethereum Smart Contracts. Proceedings of the 2018 Annual Computer Security Applications Conference (ACSAC 2018), San Juan, PR, USA.10.1145/3274694.3274737 ↗
38. Luu, L., Chu, D.-H., Olickel, H., Saxena, P., and Hobor, A. (2016, January 24–28). Making smart contracts smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security (CCS), Vienna, Austria.10.1145/2976749.2978309 ↗
39. Chee, C.Y.M., Pal, S., Pan, L., and Doss, R. (2023, January 10–14). An analysis of important factors affecting the success of blockchain smart contract security vulnerability scanning tools. Proceedings of the 5th ACM International Symposium on Blockchain and Secure Critical Infrastructure (BSCI 2023), Melbourne, Australia.10.1145/3594556.3594615 ↗
40. Fu, M., and Tantithamthavorn, C. (2022, January 23–24). LineVul: A transformer-based line-level vulnerability prediction. Proceedings of the 19th International Conference on Mining Software Repositories (MSR 2022), Pittsburgh, PA, USA.10.1145/3524842.3528452 ↗
41. Semi-Supervised Classification of Graph Convolutional Networks with Laplacian Rank Constraints10.1007/s11063-020-10404-7 ↗
42. Zhuang, Y., Liu, Z., Qian, P., Liu, Q., Wang, X., and He, Q. (2020, January 11–17). Smart contract vulnerability detection using graph neural networks. Proceedings of the 29th International Joint Conference on Artificial Intelligence (IJCAI 2020), Virtual.10.24963/ijcai.2020/454 ↗
43. Hybrid analysis of integer overflow vulnerabilities in Ethereum smart contracts10.1016/j.future.2021.02.015 ↗
44. Wu, H., Zhang, Z., Wang, S., Lei, Y., Lin, B., Qin, Y., Zhang, H., and Mao, X. (2021, January 25–28). Peculiar: Smart contract vulnerability detection based on crucial data flow graph and pre-training techniques. Proceedings of the 32nd IEEE International Symposium on Software Reliability Engineering (ISSRE 2021), Wuhan, China.10.1109/ISSRE52982.2021.00047 ↗
45. Machine learning-based detection of reentrancy vulnerabilities in smart contracts
46. He, L., Zhao, X., and Wang, Y. (October, January 30). GraphSA: Smart Contract Vulnerability Detection Combining Graph Neural Networks and Static Analysis. Proceedings of the 26th European Conference on Artificial Intelligence ECAI 2023, Krakow, Poland. Frontiers in Artificial Intelligence and Applications.10.3233/FAIA230374 ↗