论文标题

缺陷检查员:通过分析EVM字节码来自动化智能合约缺陷检测

DEFECTCHECKER: Automated Smart Contract Defect Detection by Analyzing EVM Bytecode

论文作者

Chen, Jiachi, Xia, Xin, Lo, David, Grundy, John, Luo, Xiapu, Chen, Ting

论文摘要

智能合约是在区块链上运行的图灵完整程序。它们是不变的,即使检测到错误,也无法修改。因此,在将智能合约部署到区块链之前,确保智能合约是无障碍和精心设计的,这是非常重要的。合同缺陷是智能合约中的错误,缺陷或故障,导致其产生不正确或意外的结果,或以意想不到的方式行事。检测和删除合同缺陷可以避免潜在的错误,并使程序更强大。我们以前的工作定义了20个智能合约的合同缺陷,并将其分为五个影响水平。根据我们的分类,在1-3之间具有严重性水平的合同缺陷可能导致不良行为,例如,攻击者控制的合同。在本文中,我们提出了一种基于符号执行的方法和工具,以检测八种可能在以太坊区块链平台上引起智能合约不良行为的合同缺陷。缺陷检查员可以从智能合约字节码检测合同缺陷。我们将缺陷检查与以前的关键作品进行比较,包括Oyente,MyThril和使用开源数据集进行确保。我们的实验结果表明,在速度和准确性方面,缺陷检查比这些工具的表现要好得多。我们还在以太坊平台上应用了缺陷检查员到165,621个不同的智能合约。我们发现,其中25,815个智能合约至少包含属于影响1-3级的合同缺陷,包括一些现实世界中的攻击。

Smart contracts are Turing-complete programs running on the blockchain. They are immutable and cannot be modified, even when bugs are detected. Therefore, ensuring smart contracts are bug-free and well-designed before deploying them to the blockchain is extremely important. A contract defect is an error, flaw or fault in a smart contract that causes it to produce an incorrect or unexpected result, or to behave in unintended ways. Detecting and removing contract defects can avoid potential bugs and make programs more robust. Our previous work defined 20 contract defects for smart contracts and divided them into five impact levels. According to our classification, contract defects with seriousness level between 1-3 can lead to unwanted behaviors, e.g., a contract being controlled by attackers. In this paper, we propose DefectChecker, a symbolic execution-based approach and tool to detect eight contract defects that can cause unwanted behaviors of smart contracts on the Ethereum blockchain platform. DefectChecker can detect contract defects from smart contracts bytecode. We compare DefectChecker with key previous works, including Oyente, Mythril and Securify by using an open-source dataset. Our experimental results show that DefectChecker performs much better than these tools in terms of both speed and accuracy. We also applied DefectChecker to 165,621 distinct smart contracts on the Ethereum platform. We found that 25,815 of these smart contracts contain at least one of the contract defects that belongs to impact level 1-3, including some real-world attacks.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源