A Smart Contract Vulnerability Detection System Based on BERT Model and Fuzz Testing

Zhehao Liang,Baojiang Cui,Dongbin Wang,Jie Xu,Huipeng Liu
DOI: https://doi.org/10.1007/978-3-031-64766-6_29
2024-01-01
Abstract:Smart contracts have experienced wide and rapid development across various fields due to their decentralization, immutability, and automation advantages. However, vulnerabilities in smart contract have also caused significant losses for contract users and developers. To enhance the accuracy of smart contract vulnerability detection, we combine machine learning pre-training model BERT with improved fuzz testing. We employ the AST tree algorithm to extract crucial information from contracts, converting them into data flow graphs. Then the pre-trained model BERT is utilized to filter contract vulnerabilities. After that fuzz testing is adopted to further classify contracts. Experimental results demonstrate the algorithm's outstanding performance in detecting reentrancy, tx.origin, and timestamp vulnerabilities, with a precision rate of 95.93%, a recall rate of 87.25%, and an F1 score of 91.01% in detecting reentrancy vulnerabilities specifically. Comparison with other vulnerability detection tools confirms the superiority of the proposed scheme.
What problem does this paper attempt to address?