Smarter Contracts: Detecting Vulnerabilities in Smart Contracts with Deep Transfer Learning

Christoph Sendner, Huili Chen, H. Fereidooni, Lukas Petzi, Jan König, Jasper Stang, A. Dmitrienko, A. Sadeghi, F. Koushanfar
{"title":"Smarter Contracts: Detecting Vulnerabilities in Smart Contracts with Deep Transfer Learning","authors":"Christoph Sendner, Huili Chen, H. Fereidooni, Lukas Petzi, Jan König, Jasper Stang, A. Dmitrienko, A. Sadeghi, F. Koushanfar","doi":"10.14722/ndss.2023.23263","DOIUrl":null,"url":null,"abstract":"—Ethereum smart contracts are automated decen- tralized applications on the blockchain that describe the terms of the agreement between buyers and sellers, reducing the need for trusted intermediaries and arbitration. However, the deployment of smart contracts introduces new attack vectors into the cryptocurrency systems. In particular, programming flaws in smart contracts have been already exploited to lead to enormous financial loss. Hence, it is crucial to detect various vulnerability types in contracts effectively and efficiently. Existing vulnerability detection methods are limited in scope as they typically focus on one or a very limited set of vulnerabilities. Also, extending them to new vulnerability types requires costly re-design. In this work, we develop ESCORT, a deep learning-based vulnerability detection method that uses a common feature extractor to learn generic bytecode semantics of smart contracts and separate branches to learn the features of each vulnerability type. As a multi-label classifier, ESCORT can detect multiple vulnerabilities of the contract at once. Compared to prior detection methods, ESCORT can be easily extended to new vulnerability types with limited data via transfer learning. When a new vulnerability type emerges, ESCORT adds a new branch to the trained feature extractor and trains it with limited data. We evaluated ESCORT on a dataset of 3.61 million smart contracts and demonstrate that it achieves an average F1 score of 98 % on six vulnerability types in initial training and yields an average F1 score of 96 % in transfer learning phase on five additional vulnerability types. To the best of our knowledge, ESCORT is the first deep learning-based framework that utilizes transfer learning on new vulnerability types with minimal model modification and re-training overhead. Compared with existing non-ML tools, ESCORT can be applied to contracts of arbitrary complexity and ensures 100% contract coverage. In addition, we enable concurrent detection of multiple vulnerability types using a single unified framework, thus avoiding the efforts of setting up","PeriodicalId":199733,"journal":{"name":"Proceedings 2023 Network and Distributed System Security Symposium","volume":"72 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings 2023 Network and Distributed System Security Symposium","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.14722/ndss.2023.23263","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

Abstract

—Ethereum smart contracts are automated decen- tralized applications on the blockchain that describe the terms of the agreement between buyers and sellers, reducing the need for trusted intermediaries and arbitration. However, the deployment of smart contracts introduces new attack vectors into the cryptocurrency systems. In particular, programming flaws in smart contracts have been already exploited to lead to enormous financial loss. Hence, it is crucial to detect various vulnerability types in contracts effectively and efficiently. Existing vulnerability detection methods are limited in scope as they typically focus on one or a very limited set of vulnerabilities. Also, extending them to new vulnerability types requires costly re-design. In this work, we develop ESCORT, a deep learning-based vulnerability detection method that uses a common feature extractor to learn generic bytecode semantics of smart contracts and separate branches to learn the features of each vulnerability type. As a multi-label classifier, ESCORT can detect multiple vulnerabilities of the contract at once. Compared to prior detection methods, ESCORT can be easily extended to new vulnerability types with limited data via transfer learning. When a new vulnerability type emerges, ESCORT adds a new branch to the trained feature extractor and trains it with limited data. We evaluated ESCORT on a dataset of 3.61 million smart contracts and demonstrate that it achieves an average F1 score of 98 % on six vulnerability types in initial training and yields an average F1 score of 96 % in transfer learning phase on five additional vulnerability types. To the best of our knowledge, ESCORT is the first deep learning-based framework that utilizes transfer learning on new vulnerability types with minimal model modification and re-training overhead. Compared with existing non-ML tools, ESCORT can be applied to contracts of arbitrary complexity and ensures 100% contract coverage. In addition, we enable concurrent detection of multiple vulnerability types using a single unified framework, thus avoiding the efforts of setting up
智能合约:利用深度迁移学习检测智能合约中的漏洞
以太坊智能合约是区块链上的自动去中心化应用程序,描述了买卖双方之间的协议条款,减少了对可信中介和仲裁的需求。然而,智能合约的部署为加密货币系统引入了新的攻击媒介。特别是,智能合约中的编程缺陷已经被利用,导致了巨大的经济损失。因此,有效和高效地检测合同中的各种漏洞类型至关重要。现有漏洞检测方法的范围有限,因为它们通常只关注一个或一组非常有限的漏洞。此外,将它们扩展到新的漏洞类型需要昂贵的重新设计。在这项工作中,我们开发了基于深度学习的漏洞检测方法ESCORT,该方法使用通用特征提取器来学习智能合约的通用字节码语义,并使用单独的分支来学习每种漏洞类型的特征。作为一个多标签分类器,ESCORT可以同时检测到合约的多个漏洞。与之前的检测方法相比,通过迁移学习,可以很容易地扩展到数据有限的新漏洞类型。当出现新的漏洞类型时,ESCORT会在训练好的特征提取器中添加新的分支,并使用有限的数据对其进行训练。我们在361万个智能合约的数据集上评估了ESCORT,并证明它在初始训练中对六种漏洞类型达到了98%的平均F1分数,在迁移学习阶段对另外五种漏洞类型产生了96%的平均F1分数。据我们所知,ESCORT是第一个基于深度学习的框架,它利用迁移学习对新的漏洞类型进行最小的模型修改和重新训练开销。与现有的非ml工具相比,ESCORT可以应用于任意复杂性的合同,并确保100%的合同覆盖率。此外,我们可以使用一个统一的框架同时检测多种漏洞类型,从而避免了设置的工作量
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
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学术官方微信