ReDefender: Detecting Reentrancy Vulnerabilities in Smart Contracts Automatically
- 13 April 2022
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Reliability
- Vol. 71 (2) , 984-999
Abstract
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.Keywords
Funding Information
- National Key Research and Development Program of China (2019YFE0105500)
- Norges Forskningsråd (309494)
- Key Research and Development Program of Jiangsu Province (BE2021002-3)
This publication has 27 references indexed in Scilit:
- Securify2018
- ContractFuzzer: fuzzing smart contracts for vulnerability detection2018
- SmartCheck2018
- Towards verifying ethereum smart contract bytecode in Isabelle/HOL2018
- Coverage-Based Greybox Fuzzing as Markov ChainIEEE Transactions on Software Engineering, 2017
- Be more familiar with our enemies and pave the way forward: A review of the roles bugs played in software failuresJournal of Systems and Software, 2017
- Blockchain beyond bitcoinCommunications of the ACM, 2016
- Making Smart Contracts Smarter2016
- Formal Verification of Smart Contracts2016
- Recent Catastrophic Accidents: Investigating How Software was Responsible2010