CodeBERT-Based Embeddings for Detecting Vulnerable Smart Contracts
Smart contracts are a key part of blockchain applications, and attackers can exploit them to manipulate contract behaviour or steal assets. Smart contracts often contain security vulnerabilities, either accidentally introduced by developers or due to flawed business logic. In this paper, we focus on finding an optimal Machine Learning based framework for detecting vulnerable smart contracts by analysing the smart contracts as embedding vectors. CodeBERT, a pre-trained transformer model, is used for feature extraction in the proposed framework. The framework has shown approximately 97% accuracy in detecting smart contracts that contain various vulnerabilities. Additionally, the research explores the performance of CodeBERT variants for this task. The results of the experiments have proven the favourability of this framework in detecting vulnerable smart contracts.
Authors
- Awarjana Perera
- Anand S. Rao (ORCID: https://orcid.org/0000-0001-7362-5173)
- Vallipuram Muthukkumarasamy (ORCID: https://orcid.org/0000-0002-6787-6379)
- Jeyakumar Samantha Tharani (ORCID: https://orcid.org/0000-0002-3187-6131)
- Babu Pillai (ORCID: https://orcid.org/0000-0003-4675-154X)
Institutions
- Griffith University (AU)
- University of Jaffna (LK)
Publication Details
- Published
- 2025-09-15
- DOI
- https://doi.org/10.1109/lcn65610.2025.11146388
- Citations
- 1
- Primary Topic
- Blockchain Technology Applications and Security
- Type
- article
- Field-Weighted Citation Impact
- 3.25