A bytecode-based integrated detection and repair method for reentrancy vulnerabilities in smart contracts

被引:0
|
作者
Feng Z. [1 ]
Feng Y. [2 ,3 ]
He H. [1 ]
Zhang W. [2 ,3 ,4 ]
Zhang Y. [1 ,3 ]
机构
[1] School of Cyberspace Science, Harbin Institute of Technology, Harbin
[2] School of Computer Science and Technology, Harbin Institute of Technology, Shenzhen
[3] Department of New Networks, Peng Cheng Laboratory, Shenzhen
[4] Guangdong Provincial Key Laboratory of Novel Security Intelligence Technologies, Shenzhen
来源
IET Blockchain | 2024年 / 4卷 / 03期
关键词
artificial intelligence and data science; blockchain platforms models and analysis; contracts; data mining; ethereum;
D O I
10.1049/blc2.12043
中图分类号
学科分类号
摘要
The reentrancy vulnerability in smart contracts has caused significant losses in the digital currency economy. Existing solutions for detecting and repairing this vulnerability are limited in scope and lack a comprehensive framework. Additionally, there is currently a lack of guidance methods for effectively pinpointing the location of vulnerabilities. The proposed bytecode-level method addresses these challenges by incorporating a detection module, an auxiliary localization module, and a repair module. An opcode classification method is introduced using vulnerability features and a BiLSTM-Attention-based sequence model to enhance detection accuracy. To overcome difficulties in vulnerability localization, an auxiliary localization method based on data flow and control flow analysis is proposed, enabling developers to better locate vulnerabilities. Current reentrancy vulnerability repair methods are analyzed and strategies for three reachable patterns are proposed. The bytecode rewriting strategy utilizes Trampoline technology for repair, while a fuel optimization method reduces bytecode generation length to optimize gas costs. Through extensive experimental validation, the effectiveness and superiority of the proposed methods are confirmed, further validating the feasibility of the entire framework. Experimental results demonstrate that the framework offers enhanced protection against reentrancy vulnerability attacks in smart contracts. © 2023 The Authors. IET Blockchain published by John Wiley & Sons Ltd on behalf of The Institution of Engineering and Technology.
引用
收藏
页码:235 / 251
相关论文
共 50 条
  • [1] ReDefender: Detecting Reentrancy Vulnerabilities in Smart Contracts Automatically
    Li, Bixin
    Pan, Zhenyu
    Hu, Tianyuan
    IEEE TRANSACTIONS ON RELIABILITY, 2022, 71 (02) : 984 - 999
  • [2] 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
  • [3] ReDefender: A Tool for Detecting Reentrancy Vulnerabilities in Smart Contracts Effectively
    Pan, Zhenyu
    Hu, Tianyuan
    Qian, Chen
    Li, Bixin
    2021 IEEE 21ST INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY (QRS 2021), 2021, : 915 - 925
  • [4] Towards Automated Reentrancy Detection for Smart Contracts Based on Sequential Models
    Qian, Peng
    Liu, Zhenguang
    He, Qinming
    Zimmermann, Roger
    Wang, Xun
    IEEE ACCESS, 2020, 8 : 19685 - 19695
  • [5] ReenRepair: Automatic and semantic equivalent repair of reentrancy in smart contracts
    Huang, Ruiyao
    Shen, Qingni
    Wang, Yuchen
    Wu, Yiqi
    Wu, Zhonghai
    Luo, Xiapu
    Ruan, Anbang
    JOURNAL OF SYSTEMS AND SOFTWARE, 2024, 216
  • [6] ReDetect: Reentrancy Vulnerability Detection in Smart Contracts with High Accuracy
    Yu, Rutao
    Shu, Jiangang
    Yan, Dekai
    Jia, Xiaohua
    2021 17TH INTERNATIONAL CONFERENCE ON MOBILITY, SENSING AND NETWORKING (MSN 2021), 2021, : 412 - 419
  • [7] Formal Analysis of Reentrancy Vulnerabilities in Smart Contract Based on CPN
    He, Yaqiong
    Dong, Hanjie
    Wu, Huaiguang
    Duan, Qianheng
    ELECTRONICS, 2023, 12 (10)
  • [8] Cross-Contract Static Analysis for Detecting Practical Reentrancy Vulnerabilities in Smart Contracts
    Xue, Yinxing
    Ma, Mingliang
    Lin, Yun
    Sui, Yulei
    Ye, Jiaming
    Peng, Tianyong
    2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, : 1029 - 1040
  • [9] Turn the Rudder: A Beacon of Reentrancy Detection for Smart Contracts on Ethereum
    Zheng, Zibin
    Zhang, Neng
    Su, Jianzhong
    Zhong, Zhijie
    Ye, Mingxi
    Chen, Jiachi
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 295 - 306
  • [10] Detection of Vulnerabilities of Blockchain Smart Contracts
    He, Daojing
    Wu, Rui
    Li, Xinji
    Chan, Sammy
    Guizani, Mohsen
    IEEE INTERNET OF THINGS JOURNAL, 2023, 10 (14) : 12178 - 12185