journal article·2023Open access

GRATDet: Smart Contract Vulnerability Detector Based on Graph Representation and Transformer

Peng Gong, Wenzhong Yang, Liejun Wang, Fuyuan Wei, KeZiErBieKe HaiLaTi, Yuanyuan Liao

Computers, Materials & Continua· Volume 76· Issue 2

Abstract

Smart contracts have led to more efficient development in finance and healthcare, but vulnerabilities in contracts pose high risks to their future applications. The current vulnerability detection methods for contracts are either based on fixed expert rules, which are inefficient, or rely on simplistic deep learning techniques that do not fully leverage contract semantic information. Therefore, there is ample room for improvement in terms of detection precision. To solve these problems, this paper proposes a vulnerability detector based on deep learning techniques, graph representation, and Transformer, called GRATDet. The method first performs swapping, insertion, and symbolization operations for contract functions, increasing the amount of small sample data. Each line of code is then treated as a basic semantic element, and information such as control and data relationships is extracted to construct a new representation in the form of a Line Graph (LG), which shows more structural features that differ from the serialized presentation of the contract. Finally, the node information and edge information of the graph are jointly learned using an improved Transformer–GP model to extract information globally and locally, and the fused features are used for vulnerability detection. The effectiveness of the method in reentrancy vulnerability detection is verified in experiments, where the F1 score reaches 95.16%, exceeding state-of-the-art methods.
Source: openalex_inverted_index · Quality: candidate unverified · Source record ↗

Research context

OpenAlex topics: Blockchain Technology Applications and Security · Crime, Illicit Activities, and Governance · Cybercrime and Law Enforcement Studies

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

References (39)

Show source-provided references
1. S. Nakamoto, “Bitcoin: A peer-to-peer electronic cash system,” 2008. [Online]. Available: https://bitcoin.org/bitcoin.pdf
2. G. Wood, “Ethereum: A secure decentralised generalised transaction ledger,” 2013. [Online]. Available: http://gavwood.com/paper.pdf
3. V. Buterin, “A next-generation smart contract and decentralized application platform,” 2014. [Online]. Available: https://www.ethereum.org/pdfs/EthereumWhitePaper.pdf
4. Understanding a revolutionary and flawed grand experiment in blockchain: The DAO attack10.4018/JCIT.2019010102 ↗
5. Software vulnerability detection using deep neural networks: A survey10.1109/JPROC.2020.2993293 ↗
6. T. H. D. Huang, “Hunting the ethereum smart contract: Color-inspired inspection of potential attacks,” 2018. [Online]. Available: https://arxiv.org/abs/1807.01868
7. Towards automated reentrancy detection for smart contracts based on sequential models10.1109/ACCESS.2020.2969429 ↗
8. DeeSCVHunter: A deep learning-based framework for smart contract vulnerability detection
9. Smart contract vulnerability detection using graph neural network
10. Z. Liu, P. Qian, X. Wang, L. Zhu, Q. He et al., “Smart contract vulnerability detection: From pure neural network to interpretable graph feature and expert pattern fusion,” 2021. [Online]. Available: https://arxiv.org/abs/2106.0928210.24963/ijcai.2021/379 ↗
11. Combining graph neural networks with expert knowledge for smart contract vulnerability detection
12. B. Mueller, “Mythril—Reversing and Bug Hunting Framework for the Ethereum Blockchain,” 2017. [Online]. Available: https://github.com/b-mueller/mythril/
13. Making smart contracts smarter
14. Smartcheck: Static analysis of ethereum smart contracts
15. Securify: Practical security analysis of smart contracts
16. Slither: A static analysis framework for smart contracts
17. Manticore: A user-friendly symbolic execution framework for binaries and smart contracts
18. Vuldeepecker: A deep learning-based system for vulnerability detection
19. Automated vulnerability detection in source code using deep representation learning
20. Security vulnerability detection using deep learning natural language processing
21. Cross-project transfer representation learning for vulnerable function discovery10.1109/TII.2018.2821768 ↗
22. Vulnerability prediction from source code using machine learning10.1109/ACCESS.2020.3016774 ↗
23. Peculiar: Smart contract vulnerability detection based on crucial data flow graph and pre-training techniques
24. Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks
25. Combining graph-based learning with automated data collection for code vulnerability detection10.1109/TIFS.2020.3044773 ↗
26. Cbgru: A detection method of smart contract vulnerability based on a hybrid model
27. Smart contract vulnerability detection based on hybrid attention mechanism model10.3390/app13020770 ↗
28. Attention is all you need
29. Swin transformer: Hierarchical vision transformer using shifted windows
30. DLBT: Deep learning-based transformer to generate Pseudo-Code from source code10.32604/cmc.2022.019884 ↗
31. Deepwukong: Statically detecting software vulnerabilities using deep graph neural network10.1145/3436877 ↗
32. Eda: Easy data augmentation techniques for boosting performance on text classification tasks
33. JoranHonig, “tree-sitter-solidity,” [Online]. Available: https://github.com/JoranHonig/tree-sitter-solidity
34. Global relational models of source code
35. Self-attention with relative position representations
36. Distributed representations of sentences and documents
37. I. Schlag, P. Smolensky, R. Fernandez, N. Jojic, J. Schmidhuber et al., “Enhancing the transformer with explicit relational encoding for math problem solving,” 2019. [Online]. Available: https://arxiv.org/abs/1910.06611
38. Smartbugs: A framework to analyze solidity smart contracts
39. Rethinking the value of transformer components