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
相关论文
共 50 条
[21]   SNOW: An Effective Smart Contract Reentrancy Vulnerability Detection Method Based on Joint Feature Graph and Hybrid Graph Neural Network [J].
Lian, Wenjuan ;
Zhang, Xinze ;
Bao, Zikang ;
Jia, Bin .
SOFTWARE-PRACTICE & EXPERIENCE, 2025,
[22]   Smart Contract Vulnerability Detection Method Based on Feature Graph and Multiple Attention Mechanisms [J].
He, Zhenxiang ;
Zhao, Zhenyu ;
Chen, Ke ;
Liu, Yanlin .
CMC-COMPUTERS MATERIALS & CONTINUA, 2024, 79 (02) :3023-3045
[23]   Extended Abstract of Combine Sliced Joint Graph with Graph Neural Networks for Smart Contract Vulnerability Detection [J].
Cai, Jie ;
Li, Bin ;
Zhang, Jiale ;
Sun, Xiaobing ;
Chen, Bing .
2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING, SANER, 2023, :851-852
[24]   A Smart Contract Vulnerability Detection Mechanism Based on Deep Learning and Expert Rules [J].
Liu, Zhenpeng ;
Jiang, Mingxiao ;
Zhang, Shengcong ;
Zhang, Jialiang ;
Liu, Yi .
IEEE ACCESS, 2023, 11 :77990-77999
[25]   Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion [J].
Deng, Weichu ;
Wei, Huanchun ;
Huang, Teng ;
Cao, Cong ;
Peng, Yun ;
Hu, Xuan .
SENSORS, 2023, 23 (16)
[26]   Smart Contract Vulnerability Detection Based on Automated Feature Extraction and Feature Interaction [J].
Li, Lina ;
Liu, Yang ;
Sun, Guodong ;
Li, Nianfeng .
IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2024, 36 (09) :4916-4929
[27]   Smart contract vulnerability detection method based on pre-training and novel timing graph neural network [J].
Zhuang, Yuan ;
Fan, Zekai ;
Wang, Cheng ;
Sun, Jianguo ;
Li, Yaolin .
Tongxin Xuebao/Journal on Communications, 2024, 45 (09) :101-114
[28]   Peculiar: Smart Contract Vulnerability Detection Based on Crucial Data Flow Graph and Pre-training Techniques [J].
Wu, Hongjun ;
Zhang, Zhuo ;
Wang, Shangwen ;
Lei, Yan ;
Lin, Bo ;
Qin, Yihao ;
Zhang, Haoyu ;
Mao, Xiaoguang .
2021 IEEE 32ND INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE 2021), 2021, :378-389
[29]   DA-GNN: A smart contract vulnerability detection method based on Dual Attention Graph Neural Network [J].
Zhen, Zixian ;
Zhao, Xiangfu ;
Zhang, Jinkai ;
Wang, Yichen ;
Chen, Haiyue .
COMPUTER NETWORKS, 2024, 242
[30]   Smart Contract Vulnerability Detection Using Large Language Models and Graph Structural Analysis [J].
Choi, Ra-Yeon ;
Song, Yeji ;
Jang, Minsoo ;
Kim, Taekyung ;
Ahn, Jinhyun ;
Im, Dong-Hyuk .
CMC-COMPUTERS MATERIALS & CONTINUA, 2025, 83 (01) :785-801