Cargando…

Deep learning-based solution for smart contract vulnerabilities detection

This paper aims to explore the application of deep learning in smart contract vulnerabilities detection. Smart contracts are an essential part of blockchain technology and are crucial for developing decentralized applications. However, smart contract vulnerabilities can cause financial losses and sy...

Descripción completa

Detalles Bibliográficos
Autores principales: Tang, Xueyan, Du, Yuying, Lai, Alan, Zhang, Ze, Shi, Lingzhi
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Nature Publishing Group UK 2023
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10654660/
https://www.ncbi.nlm.nih.gov/pubmed/37973832
http://dx.doi.org/10.1038/s41598-023-47219-0
_version_ 1785147865308332032
author Tang, Xueyan
Du, Yuying
Lai, Alan
Zhang, Ze
Shi, Lingzhi
author_facet Tang, Xueyan
Du, Yuying
Lai, Alan
Zhang, Ze
Shi, Lingzhi
author_sort Tang, Xueyan
collection PubMed
description This paper aims to explore the application of deep learning in smart contract vulnerabilities detection. Smart contracts are an essential part of blockchain technology and are crucial for developing decentralized applications. However, smart contract vulnerabilities can cause financial losses and system crashes. Static analysis tools are frequently used to detect vulnerabilities in smart contracts, but they often result in false positives and false negatives because of their high reliance on predefined rules and lack of semantic analysis capabilities. Furthermore, these predefined rules quickly become obsolete and fail to adapt or generalize to new data. In contrast, deep learning methods do not require predefined detection rules and can learn the features of vulnerabilities during the training process. In this paper, we introduce a solution called Lightning Cat which is based on deep learning techniques. We train three deep learning models for detecting vulnerabilities in smart contract: Optimized-CodeBERT, Optimized-LSTM, and Optimized-CNN. Experimental results show that, in the Lightning Cat we propose, Optimized-CodeBERT model surpasses other methods, achieving an f1-score of 93.53%. To precisely extract vulnerability features, we acquire segments of vulnerable code functions to retain critical vulnerability features. Using the CodeBERT pre-training model for data preprocessing, we could capture the syntax and semantics of the code more accurately. To demonstrate the feasibility of our proposed solution, we evaluate its performance using the SolidiFI-benchmark dataset, which consists of 9369 vulnerable contracts injected with vulnerabilities from seven different types.
format Online
Article
Text
id pubmed-10654660
institution National Center for Biotechnology Information
language English
publishDate 2023
publisher Nature Publishing Group UK
record_format MEDLINE/PubMed
spelling pubmed-106546602023-11-16 Deep learning-based solution for smart contract vulnerabilities detection Tang, Xueyan Du, Yuying Lai, Alan Zhang, Ze Shi, Lingzhi Sci Rep Article This paper aims to explore the application of deep learning in smart contract vulnerabilities detection. Smart contracts are an essential part of blockchain technology and are crucial for developing decentralized applications. However, smart contract vulnerabilities can cause financial losses and system crashes. Static analysis tools are frequently used to detect vulnerabilities in smart contracts, but they often result in false positives and false negatives because of their high reliance on predefined rules and lack of semantic analysis capabilities. Furthermore, these predefined rules quickly become obsolete and fail to adapt or generalize to new data. In contrast, deep learning methods do not require predefined detection rules and can learn the features of vulnerabilities during the training process. In this paper, we introduce a solution called Lightning Cat which is based on deep learning techniques. We train three deep learning models for detecting vulnerabilities in smart contract: Optimized-CodeBERT, Optimized-LSTM, and Optimized-CNN. Experimental results show that, in the Lightning Cat we propose, Optimized-CodeBERT model surpasses other methods, achieving an f1-score of 93.53%. To precisely extract vulnerability features, we acquire segments of vulnerable code functions to retain critical vulnerability features. Using the CodeBERT pre-training model for data preprocessing, we could capture the syntax and semantics of the code more accurately. To demonstrate the feasibility of our proposed solution, we evaluate its performance using the SolidiFI-benchmark dataset, which consists of 9369 vulnerable contracts injected with vulnerabilities from seven different types. Nature Publishing Group UK 2023-11-16 /pmc/articles/PMC10654660/ /pubmed/37973832 http://dx.doi.org/10.1038/s41598-023-47219-0 Text en © The Author(s) 2023 https://creativecommons.org/licenses/by/4.0/Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ (https://creativecommons.org/licenses/by/4.0/) .
spellingShingle Article
Tang, Xueyan
Du, Yuying
Lai, Alan
Zhang, Ze
Shi, Lingzhi
Deep learning-based solution for smart contract vulnerabilities detection
title Deep learning-based solution for smart contract vulnerabilities detection
title_full Deep learning-based solution for smart contract vulnerabilities detection
title_fullStr Deep learning-based solution for smart contract vulnerabilities detection
title_full_unstemmed Deep learning-based solution for smart contract vulnerabilities detection
title_short Deep learning-based solution for smart contract vulnerabilities detection
title_sort deep learning-based solution for smart contract vulnerabilities detection
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10654660/
https://www.ncbi.nlm.nih.gov/pubmed/37973832
http://dx.doi.org/10.1038/s41598-023-47219-0
work_keys_str_mv AT tangxueyan deeplearningbasedsolutionforsmartcontractvulnerabilitiesdetection
AT duyuying deeplearningbasedsolutionforsmartcontractvulnerabilitiesdetection
AT laialan deeplearningbasedsolutionforsmartcontractvulnerabilitiesdetection
AT zhangze deeplearningbasedsolutionforsmartcontractvulnerabilitiesdetection
AT shilingzhi deeplearningbasedsolutionforsmartcontractvulnerabilitiesdetection