Combining Graph Neural Networks With Expert Knowledge for Smart Contract Vulnerability Detection

被引:134
|
作者
Liu, Zhenguang [1 ,2 ]
Qian, Peng [1 ,2 ]
Wang, Xiaoyang
Zhuang, Yuan [3 ]
Qiu, Lin [4 ]
Wang, Xun [1 ,5 ]
机构
[1] Zhejiang Gongshang Univ, Sch Comp & Informat Engn, Hangzhou 310018, Peoples R China
[2] Zhejiang Univ, Hangzhou 310027, Peoples R China
[3] Natl Univ Singapore, Singapore 119077, Singapore
[4] Southern Univ Sci & Technol, Shenzhen 518055, Peoples R China
[5] Zhejiang Lab, Hangzhou 311121, Peoples R China
基金
中国国家自然科学基金;
关键词
Smart contracts; Feature extraction; Blockchain; Security; Semantics; Computer bugs; Knowledge engineering; Deep learning; blockchain; smart contract; vulnerability detection; expert knowledge; BLOCKCHAIN;
D O I
10.1109/TKDE.2021.3095196
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Smart contract vulnerability detection draws extensive attention in recent years due to the substantial losses caused by hacker attacks. Existing efforts for contract security analysis heavily rely on rigid rules defined by experts, which are labor-intensive and non-scalable. More importantly, expert-defined rules tend to be error-prone and suffer the inherent risk of being cheated by crafty attackers. Recent researches focus on the symbolic execution and formal analysis of smart contracts for vulnerability detection, yet to achieve a precise and scalable solution. Although several methods have been proposed to detect vulnerabilities in smart contracts, there is still a lack of effort that considers combining expert-defined security patterns with deep neural networks. In this paper, we explore using graph neural networks and expert knowledge for smart contract vulnerability detection. Specifically, we cast the rich control- and data- flow semantics of the source code into a contract graph. To highlight the critical nodes in the graph, we further design a node elimination phase to normalize the graph. Then, we propose a novel temporal message propagation network to extract the graph feature from the normalized graph, and combine the graph feature with designed expert patterns to yield a final detection system. Extensive experiments are conducted on all the smart contracts that have source code in Ethereum and VNT Chain platforms. Empirical results show significant accuracy improvements over the state-of-the-art methods on three types of vulnerabilities, where the detection accuracy of our method reaches 89.15, 89.02, and 83.21 percent for reentrancy, timestamp dependence, and infinite loop vulnerabilities, respectively.
引用
收藏
页码:1296 / 1310
页数:15
相关论文
共 50 条
  • [21] Graph Neural Networks for Vulnerability Detection: A Counterfactual Explanation
    Chu, Zhaoyang
    Wan, Yao
    Li, Qian
    Wu, Yang
    Zhang, Hongyu
    Sui, Yulei
    Xu, Guandong
    Jin, Hai
    PROCEEDINGS OF THE 33RD ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2024, 2024, : 389 - 401
  • [22] ReGVD: Revisiting Graph Neural Networks for Vulnerability Detection
    Van-Anh Nguyen
    Dai Quoc Nguyen
    Van Nguyen
    Trung Le
    Quan Hung Tran
    Dinh Phung
    2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2022), 2022, : 178 - 182
  • [23] Reentrancy Vulnerability Detection Based on Graph Convolutional Networks and Expert Patterns
    Guo, Longtao
    Huang, Huakun
    Xue, Sihun
    Wang, Peiliang
    Zhao, Lingjun
    2023 IEEE 16TH INTERNATIONAL SYMPOSIUM ON EMBEDDED MULTICORE/MANY-CORE SYSTEMS-ON-CHIP, MCSOC, 2023, : 312 - 316
  • [24] 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
  • [25] HGAT: smart contract vulnerability detection method based on hierarchical graph attention network
    Chuang Ma
    Shuaiwu Liu
    Guangxia Xu
    Journal of Cloud Computing, 12
  • [26] 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)
  • [27] HGAT: smart contract vulnerability detection method based on hierarchical graph attention network
    Ma, Chuang
    Liu, Shuaiwu
    Xu, Guangxia
    JOURNAL OF CLOUD COMPUTING-ADVANCES SYSTEMS AND APPLICATIONS, 2023, 12 (01):
  • [28] HSVDetector: a heterogeneous semantic graph-based method for smart contract vulnerability detection
    Zhu, Heming
    Li, Hao
    Lu, Gehao
    JOURNAL OF SUPERCOMPUTING, 2025, 81 (04):
  • [29] Comparison of Program Representations on Vulnerability Detection with Graph Neural Networks
    Choi Y.
    Kwon Y.-W.
    IEIE Transactions on Smart Processing and Computing, 2021, 10 (06): : 477 - 482
  • [30] Knowledge graph-based multimodal neural networks for smart-grid defect detection
    Li, Kaiyang
    Wang, Yaoying
    Zhu, Tianyou
    Li, Jiwei
    Ren, Junda
    Chen, Zhenyu
    ENGINEERING REPORTS, 2024, 6 (09)