arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.19112cs.CRcs.SE
收藏

揭示预谋攻击:通过识别攻击者合约检测可利用的重入漏洞

Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker Contracts

Shuo Yang, Jiachi Chen, Mingyuan Huang, Zibin Zheng, Yuan Huang

AI总结:

本文提出 BlockWatchdog 工具,通过识别攻击者合约和重入调用流来检测真正可利用的重入漏洞,并能发现 ERC 代币或自定义接口导致的新型重入漏洞,在 42 万余个以太坊合约中识别出价值约 9.086 亿美元的攻击。

摘要:

重入是智能合约中一个臭名昭著的漏洞,已导致数百万美元的财务损失。然而,当前的智能合约漏洞检测工具在识别具有重入漏洞的合约时存在较高的误报率。此外,检测到的重入合约中只有一小部分实际上能够被黑客利用,这使得这些工具在保护以太坊生态系统的实践中效果有限。在本文中,我们提出了 BlockWatchdog,一个通过识别攻击者合约来检测重入漏洞的工具。这些攻击者合约由黑客部署,用于自动利用存在漏洞的合约。通过聚焦于攻击者合约,BlockWatchdog 通过识别重入调用流,有效检测真正可利用的重入漏洞。此外,BlockWatchdog 能够检测在使用 ERC 代币或用户自定义接口时因设计不当而导致的新型重入漏洞,而当前的基于规则的工具无法检测到这些漏洞。我们基于对 281 起攻击事件中攻击者合约进行分析的实证研究获得的攻击逻辑,使用跨合约静态数据流技术实现了 BlockWatchdog。BlockWatchdog 在 421,889 个以太坊合约字节码上进行了评估,识别出 113 个攻击者合约,这些合约针对 159 个受害者合约,导致以太币和代币被盗,价值约 9.086 亿美元。值得注意的是,在被识别的 159 个受害者合约中,当前的重入检测工具只能报告其中的 18 个。

英文摘要:

Reentrancy, a notorious vulnerability in smart contracts, has led to millions of dollars in financial loss. However, current smart contract vulnerability detection tools suffer from a high false positive rate in identifying contracts with reentrancy vulnerabilities. Moreover, only a small portion of the detected reentrant contracts can actually be exploited by hackers, making these tools less effective in securing the Ethereum ecosystem in practice. In this paper, we propose BlockWatchdog, a tool that focuses on detecting reentrancy vulnerabilities by identifying attacker contracts. These attacker contracts are deployed by hackers to exploit vulnerable contracts automatically. By focusing on attacker contracts, BlockWatchdog effectively detects truly exploitable reentrancy vulnerabilities by identifying reentrant call flow. Additionally, BlockWatchdog is capable of detecting new types of reentrancy vulnerabilities caused by poor designs when using ERC tokens or user-defined interfaces, which cannot be detected by current rule-based tools. We implement BlockWatchdog using cross-contract static dataflow techniques based on attack logic obtained from an empirical study that analyzes attacker contracts from 281 attack incidents. BlockWatchdog is evaluated on 421,889 Ethereum contract bytecodes and identifies 113 attacker contracts that target 159 victim contracts, leading to the theft of Ether and tokens valued at approximately 908.6 million USD. Notably, only 18 of the identified 159 victim contracts can be reported by current reentrancy detection tools.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑