MANDO-HGT: Heterogeneous Graph Transformers for Smart Contract Vulnerability Detection

被引:2
|
作者
Nguyen, Hoang H. [1 ]
Nhat-Minh Nguyen [2 ]
Xie, Chunyao [1 ]
Ahmadi, Zahra [1 ]
Kudendo, Daniel [1 ]
Thanh-Nam Doan
Jiang, Lingxiao [2 ]
机构
[1] Leibniz Univ Hannover, Res Ctr L3S, Hannover, Germany
[2] Singapore Management Univ, Singapore, Singapore
关键词
vulnerability detection; smart contracts; source code; bytecode; heterogeneous graph learning; graph transformer;
D O I
10.1109/MSR59073.2023.00052
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Smart contracts in blockchains have been increasingly used for high-value business applications. It is essential to check smart contracts' reliability before and after deployment. Although various program analysis and deep learning techniques have been proposed to detect vulnerabilities in either Ethereum smart contract source code or bytecode, their detection accuracy and scalability are still limited. This paper presents a novel framework named MANDO-HGT for detecting smart contract vulnerabilities. Given Ethereum smart contracts, either in source code or bytecode form, and vulnerable or clean, MANDOHGT custom-builds heterogeneous contract graphs (HCGs) to represent control-flow and/or function-call information of the code. It then adapts heterogeneous graph transformers (HGTs) with customized meta relations for graph nodes and edges to learn their embeddings and train classifiers for detecting various vulnerability types in the nodes and graphs of the contracts more accurately. We have collected more than 55K Ethereum smart contracts from various data sources and verified the labels for 423 buggy and 2,742 clean contracts to evaluate MANDO-HGT. Our empirical results show that MANDO-HGT can significantly improve the detection accuracy of other stateof-the-art vulnerability detection techniques that are based on either machine learning or conventional analysis techniques. The accuracy improvements in terms of F1-score range from 0.7% to more than 76% at either the coarse-grained contract level or the fine-grained line level for various vulnerability types in either source code or bytecode. Our method is general and can be retrained easily for different vulnerability types without the need for manually defined vulnerability patterns.
引用
收藏
页码:334 / 346
页数:13
相关论文
共 50 条
  • [1] MANDO-GURU: Vulnerability Detection for Smart Contract Source Code by Heterogeneous Graph Embeddings
    Nguyen, Hoang H.
    Nhat-Minh Nguyen
    Hong-Phuc Doan
    Ahmadi, Zahra
    Thanh-Nam Doan
    Jiang, Lingxiao
    [J]. PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 1736 - 1740
  • [2] MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities
    Nguyen, Hoang H.
    Nguyen, Nhat-Minh
    Xie, Chunyao
    Ahmadi, Zahra
    Kudendo, Daniel
    Doan, Thanh-Nam
    Jiang, Lingxiao
    [J]. 2022 IEEE 9TH INTERNATIONAL CONFERENCE ON DATA SCIENCE AND ADVANCED ANALYTICS (DSAA), 2022, : 304 - 313
  • [3] Smart Contract Vulnerability Detection Using Graph Neural Networks
    Zhuang, Yuan
    Liu, Zhenguang
    Qian, Peng
    Liu, Qi
    Wang, Xiang
    He, Qinming
    [J]. PROCEEDINGS OF THE TWENTY-NINTH INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE, 2020, : 3283 - 3290
  • [4] Combine sliced joint graph with graph neural networks for smart contract vulnerability detection?
    Cai, Jie
    Li, Bin
    Zhang, Jiale
    Sun, Xiaobing
    Chen, Bing
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 195
  • [5] Combining Graph Neural Networks With Expert Knowledge for Smart Contract Vulnerability Detection
    Liu, Zhenguang
    Qian, Peng
    Wang, Xiaoyang
    Zhuang, Yuan
    Qiu, Lin
    Wang, Xun
    [J]. IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2023, 35 (02) : 1296 - 1310
  • [6] SCGformer: Smart contract vulnerability detection based on control flow graph and transformer
    Gong, KeXin
    Song, Xiangmei
    Wang, Na
    Wang, Chunyang
    Zhu, Huijuan
    [J]. IET Blockchain, 2023, 3 (04): : 213 - 221
  • [7] 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
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 202
  • [8] Extended Abstract of Combine Sliced Joint Graph with Graph Neural Networks for Smart Contract Vulnerability Detection
    Cai, Jie
    Li, Bin
    Zhang, Jiale
    Sun, Xiaobing
    Chen, Bing
    [J]. 2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING, SANER, 2023, : 851 - 852
  • [9] Smart Contract Vulnerability Detection Method Based on Feature Graph and Multiple Attention Mechanisms
    He, Zhenxiang
    Zhao, Zhenyu
    Chen, Ke
    Liu, Yanlin
    [J]. CMC-COMPUTERS MATERIALS & CONTINUA, 2024, 79 (02): : 3023 - 3045
  • [10] HGAT: smart contract vulnerability detection method based on hierarchical graph attention network
    Chuang Ma
    Shuaiwu Liu
    Guangxia Xu
    [J]. Journal of Cloud Computing, 12