Cross-Contract Static Analysis for Detecting Practical Reentrancy Vulnerabilities in Smart Contracts
Yinxing Xue, Mingliang Ma, Yun Lin, Yulei Sui, Jiaming Ye, Tianyong Peng
摘要
Reentrancy bugs, one of the most severe vulnerabilities in smart contracts, have caused huge financial loss in recent years. Researchers have proposed many approaches to detecting them. However, empirical studies have shown that these approaches suffer from undesirable false positives and false negatives, when the code under detection involves the interaction between multiple smart contracts. In this paper, we propose an accurate and efficient cross-contract reentrancy detection approach in practice. Rather than design ruleof-thumb heuristics, we conduct a large empirical study of 11714 real-world contracts from Etherscan against three well-known general-purpose security tools for reentrancy detection. We manually summarized the reentrancy scenarios where the state-of-the-art approaches cannot address. Based on the empirical evidence, we present Clairvoyance, a cross-function and cross-contract static analysis to detect reentrancy vulnerabilities in real world with significantly higher accuracy. To reduce false negatives, we enable, for the first time, a cross-contract call chain analysis by tracking possibly tainted paths. To reduce false positives, we systematically summarized five major path protective techniques (PPTs) to support fast yet precise path feasibility checking. We implemented our approach and compared Clairvoyance with five state-of-the-art tools on 17770 real-worlds contracts. The results show that Clairvoyance yields the best detection accuracy among all the five tools and also finds 101 unknown reentrancy vulnerabilities.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 26 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Reentrancy Vulnerability Detection and Localization: A Deep Learning Based Two-phase Approach 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Reentrancy Vulnerability Detection and Localization: A Deep Learning Based Two-phase Approach 引用了 Making Smart Contracts Smarter
- Reentrancy Vulnerability Detection and Localization: A Deep Learning Based Two-phase Approach 引用了 Securify: Practical Security Analysis of Smart Contracts
- Turn the Rudder: A Beacon of Reentrancy Detection for Smart Contracts on Ethereum 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Turn the Rudder: A Beacon of Reentrancy Detection for Smart Contracts on Ethereum 引用了 Making Smart Contracts Smarter
- Turn the Rudder: A Beacon of Reentrancy Detection for Smart Contracts on Ethereum 引用了 sFuzz: an efficient adaptive fuzzer for solidity smart contracts
- Turn the Rudder: A Beacon of Reentrancy Detection for Smart Contracts on Ethereum 引用了 Securify: Practical Security Analysis of Smart Contracts
- Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners? 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners? 引用了 VerX: Safety Verification of Smart Contracts
- Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners? 引用了 Making Smart Contracts Smarter
- Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners? 引用了 sFuzz: an efficient adaptive fuzzer for solidity smart contracts
- Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners? 引用了 Securify: Practical Security Analysis of Smart Contracts
- ZEUS: Analyzing Safety of Smart Contracts 引用了 Making Smart Contracts Smarter
- sFuzz: an efficient adaptive fuzzer for solidity smart contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- sFuzz: an efficient adaptive fuzzer for solidity smart contracts 引用了 Making Smart Contracts Smarter
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 ZEUS: Analyzing Safety of Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 VerX: Safety Verification of Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 Securify: Practical Security Analysis of Smart Contracts
- WASAI: uncovering vulnerabilities in Wasm smart contracts 引用了 Making Smart Contracts Smarter
- WASAI: uncovering vulnerabilities in Wasm smart contracts 引用了 sFuzz: an efficient adaptive fuzzer for solidity smart contracts
- Securify: Practical Security Analysis of Smart Contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts 引用了 Making Smart Contracts Smarter
引用它的顶会 Paper26
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program AnalysisYuqiang Sun, Daoyuan Wu, Yue Xue, Han Liu 等ICSE 2024 · 131 次引用
- Reentrancy Vulnerability Detection and Localization: A Deep Learning Based Two-phase ApproachZhuo Zhang, Yan Lei, Meng Yan, Yue Yu 等ASE 2022 · 56 次引用
- Turn the Rudder: A Beacon of Reentrancy Detection for Smart Contracts on EthereumZibin Zheng, Neng Zhang, Jianzhong Su, Zhijie Zhong 等ICSE 2023 · 52 次引用
- Smart Contract and DeFi Security Tools: Do They Meet the Needs of Practitioners?Stefanos Chaliasos, Marcos Antonios Charalambous, Liyi Zhou, Rafaila Galanopoulou 等ICSE 2024 · 49 次引用
- WASAI: uncovering vulnerabilities in Wasm smart contractsWeimin Chen, Zihan Sun, Haoyu Wang, Xiapu Luo 等ISSTA 2022 · 43 次引用
它引用的 Paper6
- Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena 等CCS 2016 · 2,306 次引用
- Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais 等CCS 2018 · 1,108 次引用
- ZEUS: Analyzing Safety of Smart ContractsSukrit Kalra, Seep Goel, Mohan Dhawan, Subodh SharmaNDSS 2018 · 595 次引用
- sFuzz: an efficient adaptive fuzzer for solidity smart contractsTai D. Nguyen, Long H. Pham, Jun Sun, Yun Lin 等ICSE 2020 · 260 次引用
- VerX: Safety Verification of Smart ContractsAnton Permenev, Dimitar Dimitrov, Petar Tsankov, Dana Drachsler-Cohen 等S&P 2020 · 251 次引用
相关 Paper
- Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker ContractsShuo Yang, Jiachi Chen, Mingyuan Huang, Zibin Zheng 等ICSE 2024 · 24 次引用
- AdvSCanner: Generating Adversarial Smart Contracts to Exploit Reentrancy Vulnerabilities Using LLM and Static AnalysisYin Wu, Xiaofei Xie, Chenyang Peng, Dijun Liu 等ASE 2024 · 9 次引用
- SmartDagger: a bytecode-based static analysis approach for detecting cross-contract vulnerabilityZeqin Liao, Zibin Zheng, Xiao Chen, Yuhong NanISSTA 2022 · 64 次引用
- Verifying Smart Contract Security against Re-entrancy Attacks through Relational Value AnalysisDivya Rathore, Kartik NagarFSE 2026
- Silence False Alarms: Identifying Anti-Reentrancy Patterns on Ethereum to Refine Smart Contract Reentrancy DetectionQiyang Song, Heqing Huang, Xiaoqi Jia, Yuanbo Xie 等NDSS 2025
