Deep learning-based solution for smart contract vulnerabilities detection.


Journal

Scientific reports
ISSN: 2045-2322
Titre abrégé: Sci Rep
Pays: England
ID NLM: 101563288

Informations de publication

Date de publication:
16 Nov 2023
Historique:
received: 24 06 2023
accepted: 10 11 2023
medline: 17 11 2023
pubmed: 17 11 2023
entrez: 17 11 2023
Statut: epublish

Résumé

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.

Identifiants

pubmed: 37973832
doi: 10.1038/s41598-023-47219-0
pii: 10.1038/s41598-023-47219-0
pmc: PMC10654660
doi:

Types de publication

Journal Article

Langues

eng

Sous-ensembles de citation

IM

Pagination

20106

Informations de copyright

© 2023. The Author(s).

Références

Sci Rep. 2022 Oct 12;12(1):17086
pubmed: 36224208
Sensors (Basel). 2022 May 08;22(9):
pubmed: 35591270
J Am Med Inform Assoc. 2011 Sep-Oct;18(5):544-51
pubmed: 21846786
Sensors (Basel). 2022 May 07;22(9):
pubmed: 35591263
Sensors (Basel). 2022 Jun 19;22(12):
pubmed: 35746403

Auteurs

Xueyan Tang (X)

Salus Security, Beijing, 100020, China. 777728@gmail.com.

Yuying Du (Y)

Salus Security, Beijing, 100020, China.

Alan Lai (A)

Salus Security, Beijing, 100020, China.

Ze Zhang (Z)

Salus Security, Beijing, 100020, China.

Lingzhi Shi (L)

Salus Security, Beijing, 100020, China.

Classifications MeSH