临时限制Solidity智能合约交互
Temporarily Restricting Solidity Smart Contract Interactions
AI总结:
该研究探讨临时限制Solidity智能合约函数调用的方法,剖析只读重入类新型攻击,指出2023年16起损失超1.36亿美元的攻击可通过该方法防范,同时指出相关方法在不同支持Solidity的链上表现可能存在差异。
摘要:
本研究探讨了在指定时长内限制调用Solidity智能合约函数能力的方法。我们描述了限制函数在同一交易、同一区块或同一时间段内被两次调用的实现方式,这与不可重入函数的概念相关——不可重入函数指可在前一次执行过程中被调用的函数。这些方法可用于限制与智能合约整组函数的交互。我们重提该主题有两个动因:其一,我们统计发现2023年有16起真实智能合约攻击事件,造成超1.36亿美元的损失或被盗,而这些攻击本可通过限制函数调用避免。作为调研的一部分,我们剖析了一类涉及所谓只读重入的新型攻击:攻击者通过重入只读函数使智能合约状态不一致,从而实施攻击。其二,尽管其中部分方法原理简单,但在支持Solidity的不同区块链上,它们的运行表现可能并不一致。
英文摘要:
In this work we explore ways to restrict the ability to call Solidity smart contract functions for a specified duration. We describe methods to restrict functions from being called twice in the same transaction, block, or time period. This is related to the notion of non-reentrant functions, which are functions that can be called within a previous execution. These methods can be used to restrict interactions with entire sets of functions of smart contracts. We are motivated to revisit this topic for two reasons. First, we note that sixteen real-world smart contracts exploits in 2023 resulting in over $136M USD lost or stolen that could have been prevented by restricting function calls. As part of this survey, we dissect a new class of exploit that involves so-called read-only reentrancy: exploits that re-enter read-only functions to make smart contract state inconsistent in order to enable their exploitation. Second, while some of these approaches are simple, they may not always behave the same across different blockchains that support Solidity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。