Analyzing the Impact of Copying-and-Pasting Vulnerable Solidity Code Snippets from Question-and-Answer Websites

Konrad Weiss, Christof Ferreira Torres, Florian Wendland
{"title":"Analyzing the Impact of Copying-and-Pasting Vulnerable Solidity Code Snippets from Question-and-Answer Websites","authors":"Konrad Weiss, Christof Ferreira Torres, Florian Wendland","doi":"arxiv-2409.07586","DOIUrl":null,"url":null,"abstract":"Ethereum smart contracts are executable programs deployed on a blockchain.\nOnce deployed, they cannot be updated due to their inherent immutability.\nMoreover, they often manage valuable assets that are worth millions of dollars,\nmaking them attractive targets for attackers. The introduction of\nvulnerabilities in programs due to the reuse of vulnerable code posted on Q&A\nwebsites such as Stack Overflow is not a new issue. However, little effort has\nbeen made to analyze the extent of this issue on deployed smart contracts. In\nthis paper, we conduct a study on the impact of vulnerable code reuse from Q&A\nwebsites during the development of smart contracts and provide tools uniquely\nfit to detect vulnerable code patterns in complete and incomplete Smart\nContract code. This paper proposes a pattern-based vulnerability detection tool\nthat is able to analyze code snippets (i.e., incomplete code) as well as full\nsmart contracts based on the concept of code property graphs. We also propose a\nmethodology that leverages fuzzy hashing to quickly detect code clones of\nvulnerable snippets among deployed smart contracts. Our results show that our\nvulnerability search, as well as our code clone detection, are comparable to\nstate-of-the-art while being applicable to code snippets. Our large-scale study\non 18,660 code snippets reveals that 4,596 of them are vulnerable, out of which\n616 can be found in 7,852 deployed smart contracts. These results highlight\nthat the reuse of vulnerable code snippets is indeed an issue in currently\ndeployed smart contracts.","PeriodicalId":501332,"journal":{"name":"arXiv - CS - Cryptography and Security","volume":"34 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-11","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Cryptography and Security","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.07586","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Ethereum smart contracts are executable programs deployed on a blockchain. Once deployed, they cannot be updated due to their inherent immutability. Moreover, they often manage valuable assets that are worth millions of dollars, making them attractive targets for attackers. The introduction of vulnerabilities in programs due to the reuse of vulnerable code posted on Q&A websites such as Stack Overflow is not a new issue. However, little effort has been made to analyze the extent of this issue on deployed smart contracts. In this paper, we conduct a study on the impact of vulnerable code reuse from Q&A websites during the development of smart contracts and provide tools uniquely fit to detect vulnerable code patterns in complete and incomplete Smart Contract code. This paper proposes a pattern-based vulnerability detection tool that is able to analyze code snippets (i.e., incomplete code) as well as full smart contracts based on the concept of code property graphs. We also propose a methodology that leverages fuzzy hashing to quickly detect code clones of vulnerable snippets among deployed smart contracts. Our results show that our vulnerability search, as well as our code clone detection, are comparable to state-of-the-art while being applicable to code snippets. Our large-scale study on 18,660 code snippets reveals that 4,596 of them are vulnerable, out of which 616 can be found in 7,852 deployed smart contracts. These results highlight that the reuse of vulnerable code snippets is indeed an issue in currently deployed smart contracts.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
分析从问答网站复制粘贴有漏洞的 Solidity 代码片段的影响
以太坊智能合约是部署在区块链上的可执行程序。一旦部署,由于其固有的不可更改性,它们就无法更新。此外,它们通常管理着价值数百万美元的宝贵资产,因此对攻击者来说是极具吸引力的目标。由于重复使用发布在 Stack Overflow 等问答网站上的漏洞代码,程序中出现漏洞并不是一个新问题。然而,人们很少努力分析这一问题在已部署的智能合约中的影响程度。在本文中,我们对智能合约开发过程中重复使用问答网站上的漏洞代码所造成的影响进行了研究,并提供了独特的工具来检测完整和不完整智能合约代码中的漏洞代码模式。本文提出了一种基于模式的漏洞检测工具,它能够分析代码片段(即不完整代码)以及基于代码属性图概念的完整智能合约。我们还提出了一种方法,利用模糊哈希算法快速检测已部署智能合约中存在漏洞的代码片段的代码克隆。我们的研究结果表明,我们的漏洞搜索和代码克隆检测与最先进的方法不相上下,同时适用于代码片段。我们对 18,660 个代码片段进行的大规模研究显示,其中 4,596 个存在漏洞,其中 616 个可以在 7,852 个已部署的智能合约中找到。这些结果突出表明,在当前部署的智能合约中,重复使用易受攻击的代码片段确实是一个问题。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
PAD-FT: A Lightweight Defense for Backdoor Attacks via Data Purification and Fine-Tuning Artemis: Efficient Commit-and-Prove SNARKs for zkML A Survey-Based Quantitative Analysis of Stress Factors and Their Impacts Among Cybersecurity Professionals Log2graphs: An Unsupervised Framework for Log Anomaly Detection with Efficient Feature Extraction Practical Investigation on the Distinguishability of Longa's Atomic Patterns
×
引用
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