ReDefender: Detecting Reentrancy Vulnerabilities in Smart Contracts Automatically

被引:22
作者
Li, Bixin [1 ]
Pan, Zhenyu [1 ]
Hu, Tianyuan [1 ]
机构
[1] Southeast Univ, Sch Comp Sci & Engn, Nanjing 211189, Peoples R China
关键词
Smart contracts; Blockchains; Fuzzing; Codes; Virtual machining; Transfer functions; Syntactics; Blockchain; ethereum; fuzzing; reentrancy; smart contract; BLOCKCHAIN;
D O I
10.1109/TR.2022.3161634
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
As one of the most complex types of vulnerabilities, reentrancy poses a significant threat to smart contract development. Indeed, millions of dollars have evaporated due to reentrancy vulnerabilities of smart contracts in past years. In this article, we propose a new approach to detect reentrancy vulnerabilities using fuzz testing and develop a novel tool named ReDefender. Our approach consists of three main steps: 1) preprocess contract to be detected: when a contract is uploaded, its source code will be preprocessed to extract candidate pool for fuzzing and dependency graph which guides the automatic deployment of contracts; 2) fuzzing input generation: fuzzing input is generated to constitute transactions which will be sent to an agent contract to stimulate attacks, where runtime information is collected and recorded in the execution log during each execution; and 3) vulnerability verification: the execution log is analyzed to determine whether a reentrancy process occurs and whether the reentrancy process is malicious. We conduct comparative experiments on 204 tagged smart contracts and 90 injected contracts. The results show higher accuracy and lower false negative rate of ReDefender than that of the other three famous tools. Moreover, we conduct an experiment on 4776 real-world contracts demonstrating the ability of ReDefender to find reentrancy vulnerabilities that really cause economic losses.
引用
收藏
页码:984 / 999
页数:16
相关论文
共 40 条
[1]   Verification of smart contracts: A survey [J].
Almakhour, Mouhamad ;
Sliman, Layth ;
Samhat, Abed Ellatif ;
Mellouk, Abdelhamid .
PERVASIVE AND MOBILE COMPUTING, 2020, 67
[2]  
Amani S., 2018, P 7 ACM SIGPLAN INT, P66, DOI DOI 10.1145/3167084
[3]  
[Anonymous], 2016, CONTRACT ABI SPECIFI
[4]  
[Anonymous], 2020, LIBFUZZER DOCUMENTAT
[5]  
[Anonymous], 2020, SMART CONTRACT WEAKN
[6]  
[Anonymous], 2021, Etherscan
[7]  
[Anonymous], 2016, Solidity documentation
[8]   Formal Verification of Smart Contracts Short Paper [J].
Bhargavan, Karthikeyan ;
Delignat-Lavaud, Antoine ;
Fournet, Cedric ;
Gollamudi, Anitha ;
Gonthier, Georges ;
Kobeissi, Nadim ;
Kulatova, Natalia ;
Rastogi, Aseem ;
Sibut-Pinote, Thomas ;
Swamy, Nikhil ;
Zanella-Beguelin, Santiago .
PROCEEDINGS OF THE 2016 ACM WORKSHOP ON PROGRAMMING LANGUAGES AND ANALYSIS FOR SECURITY (PLAS'16), 2016, :91-96
[9]   Coverage-Based Greybox Fuzzing as Markov Chain [J].
Bohme, Marcel ;
Van-Thuan Pham ;
Roychoudhury, Abhik .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2019, 45 (05) :489-506
[10]  
Chen J., IEEE T SOFTWARE ENG, V2021