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 条
  • [1] Smart Contract Vulnerability Detection Using Deep Learning Algorithms on EVM bytecode
    Prifti, Lejdi
    Cico, Betim
    Karras, Dimitrios
    2024 13TH MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING, MECO 2024, 2024, : 223 - 229
  • [2] Automated Generation of Security-Centric Descriptions for Smart Contract Bytecode
    Pan, Yu
    Xu, Zhichao
    Li, Levi Taiji
    Yang, Yunhe
    Zhang, Mu
    PROCEEDINGS OF THE 32ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2023, 2023, : 1244 - 1256
  • [3] Smart contract vulnerability detection based on a bytecode critical path
    Yin, Guisheng
    Gao, Le
    Zhuang, Yuan
    Li, Jun
    Harbin Gongcheng Daxue Xuebao/Journal of Harbin Engineering University, 2022, 43 (02): : 255 - 261
  • [4] Smart Contract Defense Through Bytecode Rewriting
    Ayoade, Gbadebo
    Bauman, Erick
    Khan, Latifur
    Hamlen, Kevin W.
    2019 IEEE INTERNATIONAL CONFERENCE ON BLOCKCHAIN (BLOCKCHAIN 2019), 2019, : 384 - 389
  • [5] WANA: Symbolic Execution of Wasm Bytecode for Extensible Smart Contract Vulnerability Detection
    Jiang, Bo
    Chen, Yifei
    Wang, Dong
    Ashraf, Imran
    Chan, W. K.
    2021 IEEE 21ST INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY (QRS 2021), 2021, : 926 - 937
  • [6] Semantic-aware Graph Neural Network for Smart Contract Bytecode Vulnerability Detection
    Zhao B.
    Shangguan C.
    Peng X.
    An Y.
    Tong J.
    Yuan A.
    Gongcheng Kexue Yu Jishu/Advanced Engineering Sciences, 2022, 54 (02): : 49 - 55
  • [7] A Bytecode-based Approach for Smart Contract Classification
    Shi, Chaochen
    Xiang, Yong
    Yu, Jiangshan
    Gao, Longxiang
    Sood, Keshav
    Doss, Robin Ram Mohan
    2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2022), 2022, : 1046 - 1054
  • [8] Automating Comment Generation for Smart Contract from Bytecode
    Xiang, Jianhang
    Gao, Zhipeng
    Bao, Lingfeng
    Hu, Xing
    Chen, Jiayuan
    Xia, Xin
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2025, 34 (03)
  • [9] TxMirror: When the Dynamic EVM Stack Meets Transactions for Smart Contract Vulnerability Detection
    Yu, Rongwei
    Zhang, Yuhang
    Wang, Yong
    Liu, Chen
    SYMMETRY-BASEL, 2023, 15 (07):
  • [10] DeepInfer: Deep Type Inference from Smart Contract Bytecode
    Zhao, Kunsong
    Li, Zihao
    Li, Jianfeng
    Ye, He
    Luo, Xiapu
    Chen, Ting
    PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023, 2023, : 745 - 757