Smart contract reentrancy vulnerability detection method based on manifold pigeon optimization algorithm
Abstract
<p indent="0mm">Reentrancy vulnerability commonly exists in smart contracts and results in serious economic losses. The existing symbolic execution-based static analyzing tools detect the reentrancy vulnerability by evaluating the default rules. However, the incompleteness of the default rules can lead to false positive judgments. We attempt to solve this problem from the perspective of test case generation based on dynamic execution. In this paper, the application scenario is abstracted as a mathematical model of the automated test case generation for path coverage (ATCG-PC) with reentrancy loop paths. The reentrancy vulnerability can be detected by executing the test cases of the reentrancy loop paths. The swarm intelligence algorithm represented by the pigeon optimization algorithm is a common method for solving the black-box optimization problem. The pigeon-inspired optimization algorithm searches in the neighbor of the population optimal solution; however, the optimal solution of the large-scale black-box optimization problem may not be in this neighbor. An improved pigeon-inspired optimization algorithm is proposed herein to improve the path coverage rate of the pigeon-inspired optimization algorithm for the ATCG-PC. The proposed algorithm allocates more computational resources to the subspace related to the target path, consequently improving the effectiveness of the pigeon-inspired optimization algorithm. It helps the pigeon-inspired optimization algorithm to cover the reentrancy loop path. The experimental results show that the improved pigeon-inspired optimization algorithm can effectively generate path coverage test cases in different smart contracts. The proposed method can also find all possible paths and accurately detect the reentrancy vulnerabilities when other tools (i.e., Oyente, Securify, and Smartcheck) make false positive judgments in the eight selected benchmarks. The recognition accuracy of the reentrancy vulnerabilities is improved by 12.5%, 12.5%, and 25%.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.