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

IET Blockchain Pub Date : 2023-09-04 DOI:10.1049/blc2.12043
Zijun Feng, Yuming Feng, Hui He, Weizhe Zhang, Yu Zhang
{"title":"A bytecode-based integrated detection and repair method for reentrancy vulnerabilities in smart contracts","authors":"Zijun Feng,&nbsp;Yuming Feng,&nbsp;Hui He,&nbsp;Weizhe Zhang,&nbsp;Yu Zhang","doi":"10.1049/blc2.12043","DOIUrl":null,"url":null,"abstract":"<p>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.</p>","PeriodicalId":100650,"journal":{"name":"IET Blockchain","volume":"4 3","pages":"235-251"},"PeriodicalIF":0.0000,"publicationDate":"2023-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://onlinelibrary.wiley.com/doi/epdf/10.1049/blc2.12043","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IET Blockchain","FirstCategoryId":"1085","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1049/blc2.12043","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

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.

Abstract Image

基于字节码的智能合约重入漏洞综合检测与修复方法
智能合约中的重入性漏洞给数字货币经济造成了巨大损失。现有的检测和修复该漏洞的解决方案范围有限,缺乏全面的框架。此外,目前还缺乏有效定位漏洞位置的指导方法。拟议的字节码级方法通过整合检测模块、辅助定位模块和修复模块来应对这些挑战。为了提高检测的准确性,引入了一种使用漏洞特征和基于 BiLSTM-Attention 序列模型的操作码分类方法。为了克服漏洞定位的困难,提出了一种基于数据流和控制流分析的辅助定位方法,使开发人员能够更好地定位漏洞。分析了当前的重入漏洞修复方法,并提出了三种可达模式的策略。字节码重写策略利用了 Trampoline 技术进行修复,而燃料优化方法则减少了字节码生成长度,以优化气体成本。通过广泛的实验验证,确认了所提方法的有效性和优越性,进一步验证了整个框架的可行性。实验结果表明,该框架可增强对智能合约中重入漏洞攻击的防护。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
1.80
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信