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

被引:0
作者
Gong, Peng [1 ,2 ]
Yang, Wenzhong [2 ,3 ]
Wang, Liejun [2 ,3 ]
Wei, Fuyuan [2 ,3 ]
HaiLaTi, KeZiErBieKe [2 ,3 ]
Liao, Yuanyuan [2 ,3 ]
机构
[1] Xinjiang Univ, Coll Informat Sci & Engn, Urumqi 830000, Peoples R China
[2] Xinjiang Univ, Key Lab Signal Detect & Proc Xinjiang Uygur Auton, Urumqi 830000, Peoples R China
[3] Xinjiang Univ, Key Lab Multilingual Informat Technol Xinjiang Uy, Urumqi 830000, Peoples R China
来源
CMC-COMPUTERS MATERIALS & CONTINUA | 2023年 / 76卷 / 02期
关键词
Vulnerability detection; smart contract; graph representation; deep learning; source code; NEURAL-NETWORKS; CODE;
D O I
10.32604/cmc.2023.038878
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
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.
引用
收藏
页码:1439 / 1462
页数:24
相关论文
共 39 条
[1]   Vulnerability Prediction From Source Code Using Machine Learning [J].
Bilgin, Zeki ;
Ersoy, Mehmet Akif ;
Soykan, Elif Ustundag ;
Tomur, Emrah ;
Comak, Pinar ;
Karacay, Leyli .
IEEE ACCESS, 2020, 8 :150672-150684
[2]  
Buterin V., 2014, ETHEREUM NEXT GENERA
[3]   DeepWukong: Statically Detecting Software Vulnerabilities Using Deep Graph Neural Network [J].
Cheng, Xiao ;
Wang, Haoyu ;
Hua, Jiayi ;
Xu, Guoai ;
Sui, Yulei .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2021, 30 (03)
[4]   Slither: A Static Analysis Framework For Smart Contracts [J].
Feist, Josselin ;
Greico, Gustavo ;
Groce, Alex .
2019 IEEE/ACM 2ND INTERNATIONAL WORKSHOP ON EMERGING TRENDS IN SOFTWARE ENGINEERING FOR BLOCKCHAIN (WETSEB 2019), 2019, :8-15
[5]   SmartBugs: A Framework to Analyze Solidity Smart Contracts [J].
Ferreira, Joao F. ;
Cruz, Pedro ;
Durieux, Thomas ;
Abreu, Rui .
2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, :1349-1352
[6]   DLBT: Deep Learning-Based Transformer to Generate Pseudo-Code from Source Code [J].
Gad, Walaa ;
Alokla, Anas ;
Nazih, Waleed ;
Aref, Mustafa ;
Salem, Abdel-badeeh .
CMC-COMPUTERS MATERIALS & CONTINUA, 2022, 70 (02) :3117-3132
[7]  
Hellendoorn, 2020, INT C LEARNING REPRE
[8]  
Huang THD, 2018, Arxiv, DOI arXiv:1807.01868
[9]  
JoranHonig, tree-sitter-solidity
[10]   VulDeePecker: A Deep Learning-Based System for Vulnerability Detection [J].
Li, Zhen ;
Zou, Deqing ;
Xu, Shouhuai ;
Ou, Xinyu ;
Jin, Hai ;
Wang, Sujuan ;
Deng, Zhijun ;
Zhong, Yuyi .
25TH ANNUAL NETWORK AND DISTRIBUTED SYSTEM SECURITY SYMPOSIUM (NDSS 2018), 2018,