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

被引:4
|
作者
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
来源
2023 IEEE/ACM 20TH INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR | 2023年
关键词
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
    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
    2022 IEEE 9TH INTERNATIONAL CONFERENCE ON DATA SCIENCE AND ADVANCED ANALYTICS (DSAA), 2022, : 304 - 313
  • [3] HSVDetector: a heterogeneous semantic graph-based method for smart contract vulnerability detection
    Zhu, Heming
    Li, Hao
    Lu, Gehao
    JOURNAL OF SUPERCOMPUTING, 2025, 81 (04):
  • [4] 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
  • [5] 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
  • [6] Combine sliced joint graph with graph neural networks for smart contract vulnerability detection?
    Cai, Jie
    Li, Bin
    Zhang, Jiale
    Sun, Xiaobing
    Chen, Bing
    JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 195
  • [7] Combining Graph Neural Networks With Expert Knowledge for Smart Contract Vulnerability Detection
    Liu, Zhenguang
    Qian, Peng
    Wang, Xiaoyang
    Zhuang, Yuan
    Qiu, Lin
    Wang, Xun
    IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2023, 35 (02) : 1296 - 1310
  • [8] 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
  • [9] 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
  • [10] 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
    2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING, SANER, 2023, : 851 - 852