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.