Smart contracts are programs deployed on a blockchain and are immutable once deployed. Reentrancy, one of the most important vulnerabilities in smart contracts, has caused millions of dollars in financial loss. Many reentrancy detection approaches have been proposed. It is necessary to investigate the performance of these approaches to provide useful guidelines for their application. In this work, we conduct a large-scale empirical study on the capability of five well-known or recent reentrancy detection tools such as Mythril and Sailfish. We collect 230,548 verified smart contracts from Etherscan and use detection tools to analyze 139,424 contracts after deduplication, which results in 21,212 contracts with reentrancy issues. Then, we manually examine the defective functions located by the tools in the contracts. From the examination results, we obtain 34 true positive contracts with reentrancy and 21,178 false positive contracts without reentrancy. We also analyze the causes of the true and false positives. Finally, we evaluate the tools based on the two kinds of contracts. The results show that more than 99.8% of the reentrant contracts detected by the tools are false positives with eight types of causes, and the tools can only detect the reentrancy issues caused by call.value(), 58.8% of which can be revealed by the Ethereum's official IDE, Remix. Furthermore, we collect real-world reentrancy attacks reported in the past two years and find that the tools fail to find any issues in the corresponding contracts. Based on the findings, existing works on reentrancy detection appear to have very limited capability, and researchers should turn the rudder to discover and detect new reentrancy patterns except those related to call.value().
翻译:智能合约是部署在区块链上的程序,一旦部署就是不可变的。回入是智能合约中最重要的漏洞之一,已经导致数百万美元的财务损失。许多回入检测方法已经被提出。有必要调查这些方法的性能,为它们的应用提供有用的指导。在这项工作中,我们对五个知名或最近的回入检测工具(如Mythril和Sailfish)的能力进行了大规模的实证研究。我们从Etherscan收集了230,548个经过验证的智能合约,使用检测工具分析了139,424个合约进行去重后的结果,发现其中21,212个合约存在回入问题。然后,我们手动检查工具在合约中定位的有缺陷的函数。从检查结果中,我们获得了34个有回入问题的真阳性合约和21,178个没有回入问题的假阳性合约。我们还分析了真阳性和假阳性的原因。最后,我们根据这两种合约评估工具。结果表明,工具检测到的回入合约中有99.8%以上是假阳性,有八种原因,工具只能检测到由call.value()引起的回入问题,其中58.8%可以在以太坊的官方IDE Remix中发现。此外,我们收集了过去两年报告的现实回入攻击,并发现工具无法在相应的合约中找到任何问题。基于这些发现,现有的回入检测工作似乎具有非常有限的能力,研究人员应该转变船舵,发现和检测除与call.value()相关的新回入模式。