Security Code Recommendations for Smart Contract

Xiao-cong Zhou, Yingye Chen, Hanyang Guo, Xiangping Chen, Yuan Huang
{"title":"Security Code Recommendations for Smart Contract","authors":"Xiao-cong Zhou, Yingye Chen, Hanyang Guo, Xiangping Chen, Yuan Huang","doi":"10.1109/SANER56733.2023.00027","DOIUrl":null,"url":null,"abstract":"A smart contract is a self-executing program that is stored on the blockchain and runs when predetermined conditions are satisfied. Many frequent transactions involving asset transfers rely on smart contracts deployed on the blockchain, making them highly vulnerable to attack, thus it is essential to ensure the security of smart contracts. Since the smart contract is immutable once deployed, developers must try their best to fix existing vulnerabilities in advance to ensure security. Current approaches for automatic program repair on the smart contracts have mainly adopted the heuristic search algorithms or defined patterns to fix several well-defined types of vulnerabilities. They can only provide security code recommendations for developers in specific scenarios. We explore more general automated program repair of smart contracts in software history.To pave the way for studying code changes related to bug fix of smart contracts in software history, we present a labeled public dataset for method-level program repair task, containing over 12 typical insecure code patterns. Unlike bugs in traditional software, the vulnerabilities of smart contracts are more associated with access control and conditional statements as smart contracts pertain to financial assets. For this problem, we devise a novel double-encoder network and use a code representation designed for the smart contract based on syntax information to repair program. By implementing and evaluating our approach on new dataset comprised of over 10,000 program pairs, we demonstrate the superiority of our approach in both qualitative and quantitative aspects.","PeriodicalId":281850,"journal":{"name":"2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","volume":"56 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-03-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SANER56733.2023.00027","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

A smart contract is a self-executing program that is stored on the blockchain and runs when predetermined conditions are satisfied. Many frequent transactions involving asset transfers rely on smart contracts deployed on the blockchain, making them highly vulnerable to attack, thus it is essential to ensure the security of smart contracts. Since the smart contract is immutable once deployed, developers must try their best to fix existing vulnerabilities in advance to ensure security. Current approaches for automatic program repair on the smart contracts have mainly adopted the heuristic search algorithms or defined patterns to fix several well-defined types of vulnerabilities. They can only provide security code recommendations for developers in specific scenarios. We explore more general automated program repair of smart contracts in software history.To pave the way for studying code changes related to bug fix of smart contracts in software history, we present a labeled public dataset for method-level program repair task, containing over 12 typical insecure code patterns. Unlike bugs in traditional software, the vulnerabilities of smart contracts are more associated with access control and conditional statements as smart contracts pertain to financial assets. For this problem, we devise a novel double-encoder network and use a code representation designed for the smart contract based on syntax information to repair program. By implementing and evaluating our approach on new dataset comprised of over 10,000 program pairs, we demonstrate the superiority of our approach in both qualitative and quantitative aspects.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
智能合约的安全代码建议
智能合约是一个自动执行的程序,存储在区块链上,并在满足预定条件时运行。许多涉及资产转移的频繁交易依赖于部署在区块链上的智能合约,这使得它们极易受到攻击,因此确保智能合约的安全性至关重要。由于智能合约一旦部署是不可变的,开发人员必须尽最大努力提前修复现有漏洞以确保安全。目前智能合约程序自动修复的方法主要是采用启发式搜索算法或定义模式来修复几种定义良好的漏洞类型。它们只能为特定场景中的开发人员提供安全代码建议。我们探索了软件历史中智能合约的更通用的自动程序修复。为了为研究软件历史中与智能合约错误修复相关的代码更改铺平道路,我们提出了一个用于方法级程序修复任务的标记公共数据集,其中包含超过12种典型的不安全代码模式。与传统软件中的漏洞不同,智能合约的漏洞更多地与访问控制和条件语句相关,因为智能合约涉及金融资产。针对这个问题,我们设计了一种新的双编码器网络,并使用基于语法信息的智能合约代码表示来修复程序。通过在由10,000多个程序对组成的新数据集上实施和评估我们的方法,我们证明了我们的方法在定性和定量方面的优越性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
TemLock: A Lightweight Template-based Approach for Fixing Deadlocks Caused by ReentrantLock Pseudocode to Code Based on Adaptive Global and Local Information µDetector: Automated Intrusion Detection for Microservices Documentation-Guided API Sequence Search without Worrying about the Text-API Semantic Gap Weak Labelling for File-level Source Code Classification
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1