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 条
  • [11] Bytecode Similarity Detection of Smart Contract across Optimization Options and Compiler Versions Based on Triplet Network
    Zhu, Di
    Yue, Feng
    Pang, Jianmin
    Zhou, Xin
    Han, Wenjie
    Liu, Fudong
    ELECTRONICS, 2022, 11 (04)
  • [12] Smart and Automated Sewer Pipeline Defect Detection and Classification
    Kaddoura, Khalid
    Atherton, Jeff
    PIPELINES 2021: PLANNING, 2021, : 135 - 143
  • [13] Machine-learning Approach using Solidity Bytecode for Smart-contract Honeypot Detection in the Ethereum
    Hara, Kazuki
    Takahashi, Takeshi
    Ishimaki, Motoya
    Omote, Kazumasa
    2021 21ST INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY COMPANION (QRS-C 2021), 2021, : 652 - 659
  • [14] Analyzing smart contract interactions and contract level state consensus
    Hu, Yao-Chieh
    Lee, Ting-Ting
    Chatzopoulos, Dimitris
    Hui, Pan
    CONCURRENCY AND COMPUTATION-PRACTICE & EXPERIENCE, 2020, 32 (12):
  • [15] VulHunter: Hunting Vulnerable Smart Contracts at EVM Bytecode-Level via Multiple Instance Learning
    Li, Zhaoxuan
    Lu, Siqi
    Zhang, Rui
    Zhao, Ziming
    Liang, Rujin
    Xue, Rui
    Li, Wenhao
    Zhang, Fan
    Gao, Sheng
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2023, 49 (11) : 4886 - 4916
  • [16] Smart Contract Vulnerability Detection Based on Automated Feature Extraction and Feature Interaction
    Li, Lina
    Liu, Yang
    Sun, Guodong
    Li, Nianfeng
    IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, 2024, 36 (09) : 4916 - 4929
  • [17] Evolution of automated weakness detection in Ethereum bytecode: a comprehensive study
    Monika di Angelo
    Thomas Durieux
    João F. Ferreira
    Gernot Salzer
    Empirical Software Engineering, 2024, 29
  • [18] Towards Automated Verification of Smart Contract Fairness
    Liu, Ye
    Li, Yi
    Lin, Shang-Wei
    Zhao, Rong
    PROCEEDINGS OF THE 28TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE '20), 2020, : 666 - 677
  • [19] Evolution of automated weakness detection in Ethereum bytecode: a comprehensive study
    di Angelo, Monika
    Durieux, Thomas
    Ferreira, Joao F.
    Salzer, Gernot
    EMPIRICAL SOFTWARE ENGINEERING, 2024, 29 (02)
  • [20] Analyzing Ethereum Smart Contract Vulnerabilities at Scale Based on Inter-Contract Dependency
    Lyu, Qiuyun
    Ma, Chenhao
    Shen, Yanzhao
    Jiao, Shaopeng
    Sun, Yipeng
    Hu, Liqin
    CMES-COMPUTER MODELING IN ENGINEERING & SCIENCES, 2023, 135 (02): : 1625 - 1647