Identification and localization of vulnerabilities in smart contracts using attention vectors analysis in a BERT-based model
| dc.contributor.author | Tereshchenko, O. I. | |
| dc.contributor.author | Komleva, N. O. | |
| dc.contributor.author | Терещенко, О. І. | |
| dc.contributor.author | Комлева, Н. О. | |
| dc.date.accessioned | 2025-12-09T09:48:25Z | |
| dc.date.available | 2025-12-09T09:48:25Z | |
| dc.date.issued | 2024 | |
| dc.description | Tereshchenko O. I. Identification and localization of vulnerabilities in smart contracts using attention vectors analysis in a BERT-based model / O. I. Tereshchenko, N. O. Komleva // Радіоелектроніка, інформатика, управління. – 2024. – № 3 (70). – C. 173-184. | |
| dc.description.abstract | EN: Context. With the development of blockchain technology and the increasing use of smart contracts, which are automatically executed in blockchain networks, the significance of securing these contracts has become extremely relevant. Traditional code auditing methods often prove ineffective in identifying complex vulnerabilities, which can lead to significant financial losses. For example, the reentrancy vulnerability that led to the DAO attack in 2016 resulted in the loss of 3.6 million ethers and the split of the Ethereum blockchain network. This underscores the necessity for early detection of vulnerabilities. Objective. The objective of this work is to develop and test an innovative approach for identifying and localizing vulnerabilities in smart contracts based on the analysis of attention vectors in a model using BERT architecture. Method. The methodology described includes data preparation and training a transformer-based model for analyzing smart contract code. The proposed attention vector analysis method allows for the precise identification of vulnerable code segments. The use of the CodeBERT model significantly improves the accuracy of vulnerability identification compared to traditional methods. Specifically, three types of vulnerabilities are considered: reentrancy, timestamp dependence, and tx.origin vulnerability. The data is preprocessed, which includes the standardization of variables and the simplification of functions. Results. The developed model demonstrated a high F-score of 95.51%, which significantly exceeds the results of contemporary approaches, such as the BGRU-ATT model with an F-score of 91.41%. The accuracy of the method in the task of localizing reentrancy vulnerabilities was 82%. Conclusions. The experiments conducted confirmed the effectiveness of the proposed solution. Prospects for further research include the integration of more advanced deep learning models, such as GPT-4 or T5, to improve the accuracy and reliability of vulnerability detection, as well as expanding the dataset to cover other smart contract languages, such as Vyper or LLL, to enhance the applicability and efficiency of the model across various blockchain platforms. Thus, the developed CodeBERT-based model demonstrates high results in detecting and localizing vulnerabilities in smart contracts, which opens new opportunities for research in the field of blockchain platform security. UK: Актуальність. З розвитком технології блокчейн та зростанням використання смарт-контрактів, які автоматично виконуються в блокчейн-мережах, значущість безпеки цих контрактів стала надзвичайно актуальною. Традиційні методи аудиту коду часто виявляються неефективними для виявлення складних уразливостей, що може призвести до значних фінансових втрат. Наприклад, уразливість повторного входу, яка призвела до атаки на DAO в 2016 році, спричинила втрату 3,6 мільйона ефірів та поділ блокчейн-мережі Ethereum. Це підкреслює необхідність раннього виявлення уразливостей. Мета роботи – розробка та апробація новаторського підходу до виявлення та локалізації уразливостей у смарт-контрактах на основі аналізу векторів уваги в моделі, що використовує архітектуру BERT. Метод. Описується методика, яка включає підготовку даних та навчання трансформерної моделі для аналізу коду смарт-контрактів. Запропонований метод аналізу векторів уваги дозволяє точно ідентифікувати уразливі ділянки коду. Використання моделі CodeBERT значно покращує точність ідентифікації уразливостей порівняно з традиційними методами. Зокрема, розглядаються три типи уразливостей: повторний вхід, залежність від часу та уразливість tx.origin. Дані попередньо нормалізуються, що включає стандартизацію змінних та спрощення функцій. Результати. Розроблена модель продемонструвала високий F-score на рівні 95,51%, що значно перевищує результати сучасних підходів, таких як модель BGRU-ATT з F-score 91,41%. Точність методу у завданні локалізації уразливості повторного входу склала 82%. Висновки. Проведені експерименти підтвердили ефективність запропонованого рішення. Перспективи подальших досліджень включають інтеграцію більш просунутих моделей глибокого навчання, таких як GPT-4 або T5, для покращення точності та надійності виявлення уразливостей, а також розширення набору даних для охоплення інших мов смарт-контрактів, таких як Vyper або LLL, для підвищення застосовності та ефективності моделі на різних блокчейн-платформах. Таким чином, розроблена модель на основі CodeBERT демонструє високі результати у виявленні та локалізації уразливостей у смарт-контрактах, що відкриває нові можливості для досліджень у сфері безпеки блокчейн-платформ. | |
| dc.identifier.uri | https://eir.zp.edu.ua/handle/123456789/25421 | |
| dc.language.iso | en | |
| dc.publisher | Національний університет «Запорізька політехніка» | |
| dc.subject | smart contracts, vulnerabilities, blockchain, machine learning, attention vector analysis, transformers, code security, code audit | |
| dc.subject | смарт-контракти, вразливості, блокчейн, машинне навчання, аналіз векторів уваги, трансформери, безпека коду, аудит коду | |
| dc.title | Identification and localization of vulnerabilities in smart contracts using attention vectors analysis in a BERT-based model | |
| dc.title.alternative | Ідентифікація та локалізація вразливостей у смарт-контрактах з використанням аналізу векторів уваги в моделі на основі BERT | |
| dc.type | Article |