SmartBugBert: BERT-Enhanced Vulnerability Detection for Smart Contract Bytecode

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Bu, Jiuyang, Li, Wenkai, Li, Zongwei, Zhang, Zeng, Li, Xiaoqi
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866908801266876416
author Bu, Jiuyang
Li, Wenkai
Li, Zongwei
Zhang, Zeng
Li, Xiaoqi
author_facet Bu, Jiuyang
Li, Wenkai
Li, Zongwei
Zhang, Zeng
Li, Xiaoqi
contents Smart contracts deployed on blockchain platforms are vulnerable to various security vulnerabilities. However, only a small number of Ethereum contracts have released their source code, so vulnerability detection at the bytecode level is crucial. This paper introduces SmartBugBert, a novel approach that combines BERT-based deep learning with control flow graph (CFG) analysis to detect vulnerabilities directly from bytecode. Our method first decompiles smart contract bytecode into optimized opcode sequences, extracts semantic features using TF-IDF, constructs control flow graphs to capture execution logic, and isolates vulnerable CFG fragments for targeted analysis. By integrating both semantic and structural information through a fine-tuned BERT model and LightGBM classifier, our approach effectively identifies four critical vulnerability types: transaction-ordering, access control, self-destruct, and timestamp dependency vulnerabilities. Experimental evaluation on 6,157 Ethereum smart contracts demonstrates that SmartBugBert achieves 90.62% precision, 91.76% recall, and 91.19% F1-score, significantly outperforming existing detection methods. Ablation studies confirm that the combination of semantic features with CFG information substantially enhances detection performance. Furthermore, our approach maintains efficient detection speed (0.14 seconds per contract), making it practical for large-scale vulnerability assessment.
format Preprint
id arxiv_https___arxiv_org_abs_2504_05002
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SmartBugBert: BERT-Enhanced Vulnerability Detection for Smart Contract Bytecode
Bu, Jiuyang
Li, Wenkai
Li, Zongwei
Zhang, Zeng
Li, Xiaoqi
Cryptography and Security
Smart contracts deployed on blockchain platforms are vulnerable to various security vulnerabilities. However, only a small number of Ethereum contracts have released their source code, so vulnerability detection at the bytecode level is crucial. This paper introduces SmartBugBert, a novel approach that combines BERT-based deep learning with control flow graph (CFG) analysis to detect vulnerabilities directly from bytecode. Our method first decompiles smart contract bytecode into optimized opcode sequences, extracts semantic features using TF-IDF, constructs control flow graphs to capture execution logic, and isolates vulnerable CFG fragments for targeted analysis. By integrating both semantic and structural information through a fine-tuned BERT model and LightGBM classifier, our approach effectively identifies four critical vulnerability types: transaction-ordering, access control, self-destruct, and timestamp dependency vulnerabilities. Experimental evaluation on 6,157 Ethereum smart contracts demonstrates that SmartBugBert achieves 90.62% precision, 91.76% recall, and 91.19% F1-score, significantly outperforming existing detection methods. Ablation studies confirm that the combination of semantic features with CFG information substantially enhances detection performance. Furthermore, our approach maintains efficient detection speed (0.14 seconds per contract), making it practical for large-scale vulnerability assessment.
title SmartBugBert: BERT-Enhanced Vulnerability Detection for Smart Contract Bytecode
topic Cryptography and Security
url https://arxiv.org/abs/2504.05002