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 条
  • [1] SCGformer: Smart contract vulnerability detection based on control flow graph and transformer
    Gong K.
    Song X.
    Wang N.
    Wang C.
    Zhu H.
    IET Blockchain, 2023, 3 (04): : 213 - 221
  • [2] An Efficient Smart Contract Vulnerability Detector Based on Semantic Contract Graphs Using Approximate Graph Matching
    Zhang, Yingli
    Ma, Jiali
    Liu, Xin
    Ye, Guodong
    Jin, Qun
    Ma, Jianhua
    Zhou, Qingguo
    IEEE INTERNET OF THINGS JOURNAL, 2023, 10 (24) : 21431 - 21442
  • [3] SCG-Detector: A Smart Contract Vulnerability Detection Method Based on Graph Attention Networks
    Gu, Xi-Guo
    Wang, Zhi-Wei
    Chen, Xiang
    He, Qi-Fan
    Cui, Zhan-Qi
    Tien Tzu Hsueh Pao/Acta Electronica Sinica, 2024, 52 (12): : 4101 - 4112
  • [4] Smart Contract Vulnerability Detection Based on Code Graph Embedding Approach
    Zhai, Yiwen
    Yang, Jia
    Zhang, Mingwu
    FRONTIERS IN CYBER SECURITY, FCS 2024, PT I, 2024, 2315 : 317 - 332
  • [5] Smart contract vulnerability detection based on semantic graph and residual graph convolutional networks with edge attention
    Chen, Da
    Feng, Lin
    Fan, Yuqi
    Shang, Siyuan
    Wei, Zhenchun
    JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 202
  • [6] Smart Contract Vulnerability Detection Using Graph Neural Networks
    Zhuang, Yuan
    Liu, Zhenguang
    Qian, Peng
    Liu, Qi
    Wang, Xiang
    He, Qinming
    PROCEEDINGS OF THE TWENTY-NINTH INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, 2020, : 3283 - 3290
  • [7] Smart Contract Vulnerability Detection Method Based on Feature Graph and Multiple Attention Mechanisms
    He, Zhenxiang
    Zhao, Zhenyu
    Chen, Ke
    Liu, Yanlin
    CMC-COMPUTERS MATERIALS & CONTINUA, 2024, 79 (02): : 3023 - 3045
  • [8] HGAT: smart contract vulnerability detection method based on hierarchical graph attention network
    Chuang Ma
    Shuaiwu Liu
    Guangxia Xu
    Journal of Cloud Computing, 12
  • [9] Smart Contract Vulnerability Detection Using Code Representation Fusion
    Wang, Ben
    Chu, Hanting
    Zhang, Pengcheng
    Dong, Hai
    2021 28TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2021), 2021, : 564 - 565
  • [10] A Novel Smart Contract Vulnerability Detection Method Based on Information Graph and Ensemble Learning
    Zhang, Lejun
    Wang, Jinlong
    Wang, Weizheng
    Jin, Zilong
    Zhao, Chunhui
    Cai, Zhennao
    Chen, Huiling
    SENSORS, 2022, 22 (09)