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

被引:165
作者
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
相关论文
共 64 条
[1]  
Allamanis M., 2018, INT C LEARNING REPRE
[2]   Convolutional Neural Networks over Control Flow Graphs for Software Defect Prediction [J].
Anh Viet Phan ;
Minh Le Nguyen ;
Lam Thu Bui .
2017 IEEE 29TH INTERNATIONAL CONFERENCE ON TOOLS WITH ARTIFICIAL INTELLIGENCE (ICTAI 2017), 2017, :45-52
[3]  
[Anonymous], 2016, The dao smart contract
[4]  
[Anonymous], 2017, An in-depth look at the parity multisig bug
[5]  
[Anonymous], 2017, PROC NETW DISTRIB SY
[6]  
[Anonymous], 2016, KING ETHER
[7]  
Antonopoulos A., 2018, Mastering Ethereum: Building smart contracts and dapps
[8]  
Antonopoulos G., 2018, Mastering Ethereum: Building SmartContracts and DApps
[9]   A Survey of Attacks on Ethereum Smart Contracts (SoK) [J].
Atzei, Nicola ;
Bartoletti, Massimo ;
Cimoli, Tiziana .
PRINCIPLES OF SECURITY AND TRUST (POST 2017), 2017, 10204 :164-186
[10]   Bitcoin as a Transaction Ledger: A Composable Treatment [J].
Badertscher, Christian ;
Maurer, Ueli ;
Tschudi, Daniel ;
Zikas, Vassilis .
ADVANCES IN CRYPTOLOGY - CRYPTO 2017, PT I, 2017, 10401 :324-356