arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1810.11605cs.CR
收藏

在智能合约中利用秩序法则

Exploiting The Laws of Order in Smart Contracts

Aashish Kolluri, Ivica Nikolic, Ilya Sergey, Aquinas Hobor, Prateek Saxena

摘要:

我们调查了基于区块链的智能合约中的一系列错误,我们称之为事件排序(或EO)错误。这些错误与合同事件的动态排序密切相关,即,调用其在区块链上的功能,并实现价值数百万美元的以太币的潜在利用。这种错误的已知示例和检测它们的现有技术已被限制为少量事件排序,通常为1或2。我们的工作提供了一个新的配方,这一般类EO的错误,发现并发性产生的长排列这样的事件。在检测我们制定的EO错误的技术挑战是固有的组合爆破路径和状态空间分析,即使是简单的合同。我们建议首次使用偏序约简技术,使用自动为合约提取的happen-before关系,以及基于动态符号执行技术的其他几种优化。我们构建了一个名为ETHRACER的自动工具,它不需要用户的提示,直接在以太坊字节码上运行。它标记了一万多个合同中的7-11%,每个合同大约18.5分钟,提供了人类分析师可以作为证人运行的紧凑事件跟踪。这些证人是如此紧凑,确认只需要几分钟的人工努力。一半的标记合约都有微妙的EO漏洞,包括携带价值数亿美元的以太币的ERC-20合约。因此,ETHRACER可以有效地检测现有工具无法检测到的一类微妙但危险的错误。

英文摘要:

We investigate a family of bugs in blockchain-based smart contracts, which we call event-ordering (or EO) bugs. These bugs are intimately related to the dynamic ordering of contract events, i.e., calls of its functions on the blockchain, and enable potential exploits of millions of USD worth of Ether. Known examples of such bugs and prior techniques to detect them have been restricted to a small number of event orderings, typicall 1 or 2. Our work provides a new formulation of this general class of EO bugs as finding concurrency properties arising in long permutations of such events. The technical challenge in detecting our formulation of EO bugs is the inherent combinatorial blowup in path and state space analysis, even for simple contracts. We propose the first use of partial-order reduction techniques, using happen-before relations extracted automatically for contracts, along with several other optimizations built on a dynamic symbolic execution technique. We build an automatic tool called ETHRACER that requires no hints from users and runs directly on Ethereum bytecode. It flags 7-11% of over ten thousand contracts analyzed in roughly 18.5 minutes per contract, providing compact event traces that human analysts can run as witnesses. These witnesses are so compact that confirmations require only a few minutes of human effort. Half of the flagged contracts have subtle EO bugs, including in ERC-20 contracts that carry hundreds of millions of dollars worth of Ether. Thus, ETHRACER is effective at detecting a subtle yet dangerous class of bugs which existing tools miss.

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

↑