DefectChecker: Automated Smart Contract Defect Detection by Analyzing EVM Bytecode

被引:53
作者
Chen, Jiachi [1 ]
Xia, Xin [1 ]
Lo, David [2 ]
Grundy, John [1 ]
Luo, Xiapu [3 ]
Chen, Ting [4 ]
机构
[1] Monash Univ, Fac Informat Technol, Clayton, Vic 3800, Australia
[2] Singapore Management Univ, Sch Informat Syst, Singapore 188065, Singapore
[3] Hong Kong Polytech Univ, Dept Comp, Hung Hom, Hong Kong, Peoples R China
[4] Univ Elect Sci & Technol China, Sch Comp Sci & Engn, Chengdu 610054, Peoples R China
基金
国家重点研发计划; 中国国家自然科学基金; 澳大利亚研究理事会;
关键词
Smart contracts; Blockchain; Tools; Computer bugs; Computer hacking; Virtual machining; Organizations; ethereum; contract defects detection; bytecode analyze; symbolic execution;
D O I
10.1109/TSE.2021.3054928
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 verify the performance of DefectChecker by applying it to an open-source dataset. Our evaluation results show that DefectChecker obtains a high F-score (88.8 percent in the whole dataset) and only requires 0.15s to analyze one smart contract on average. 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.
引用
收藏
页码:2189 / 2207
页数:19
相关论文
共 50 条
  • [31] A Survey on Ethereum Smart Contract Vulnerability Detection Using Machine Learning
    Surucu, Onur
    Yeprem, Uygar
    Wilkinson, Connor
    Hilal, Waleed
    Gadsden, S. Andrew
    Yawney, John
    Alsadi, Naseem
    Giuliano, Alessandro
    DISRUPTIVE TECHNOLOGIES IN INFORMATION SCIENCES VI, 2022, 12117
  • [32] Smart Contract Vulnerability Detection Based on Multi-Scale Encoders
    Guo, Junjun
    Lu, Long
    Li, Jingkui
    ELECTRONICS, 2024, 13 (03)
  • [33] Transaction-based classification and detection approach for Ethereum smart contract
    Hu, Teng
    Liu, Xiaolei
    Chen, Ting
    Zhang, Xiaosong
    Huang, Xiaoming
    Niu, Weina
    Lu, Jiazhong
    Zhou, Kun
    Liu, Yuan
    INFORMATION PROCESSING & MANAGEMENT, 2021, 58 (02)
  • [34] A bytecode-based integrated detection and repair method for reentrancy vulnerabilities in smart contracts
    Feng Z.
    Feng Y.
    He H.
    Zhang W.
    Zhang Y.
    IET Blockchain, 2024, 4 (03): : 235 - 251
  • [35] Design and evaluation of highly accurate smart contract code vulnerability detection framework
    Jeon, Sowon
    Lee, Gilhee
    Kim, Hyoungshick
    Woo, Simon S.
    DATA MINING AND KNOWLEDGE DISCOVERY, 2024, 38 (03) : 888 - 912
  • [36] Design and evaluation of highly accurate smart contract code vulnerability detection framework
    Sowon Jeon
    Gilhee Lee
    Hyoungshick Kim
    Simon S. Woo
    Data Mining and Knowledge Discovery, 2024, 38 : 888 - 912
  • [37] Trust-Based Smart Contract for Automated Agent to Agent Communication
    Mhamdi, Halima
    Soufiene, Ben Othman
    Zouinkhi, Ahmed
    Ali, Obaid
    Sakli, Hedi
    COMPUTATIONAL INTELLIGENCE AND NEUROSCIENCE, 2022, 2022
  • [38] Vulnerable Smart Contract Detection by means of Model Checking
    Crincoli, Giuseppe
    Iadarola, Giacomo
    La Rocca, Piera Elena
    Martinelli, Fabio
    Mercaldo, Francesco
    Santone, Antonella
    BSCI'22: PROCEEDINGS OF THE FOURTH ACM INTERNATIONAL SYMPOSIUM ON BLOCKCHAIN AND SECURE CRITICAL INFRASTRUCTURE, 2022, : 3 - 10
  • [39] ContractWard: Automated Vulnerability Detection Models for Ethereum Smart Contracts
    Wang, Wei
    Song, Jingjing
    Xu, Guangquan
    Li, Yidong
    Wang, Hao
    Su, Chunhua
    IEEE TRANSACTIONS ON NETWORK SCIENCE AND ENGINEERING, 2021, 8 (02): : 1133 - 1144
  • [40] A Survey of Vulnerability Detection Techniques by Smart Contract Tools
    Khan, Zulfiqar Ali
    Namin, Akbar Siami
    IEEE ACCESS, 2024, 12 : 70870 - 70910