A Novel Machine Learning-Based Analysis Model for Smart Contract Vulnerability

被引:20
作者
Xu, Yingjie [1 ]
Hu, Gengran [1 ]
You, Lin [1 ]
Cao, Chengtang [1 ]
机构
[1] Hangzhou Dianzi Univ, Sch Cyberspace, Hangzhou, Peoples R China
基金
中国国家自然科学基金;
关键词
Smart contract;
D O I
10.1155/2021/5798033
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
In recent years, a lot of vulnerabilities of smart contracts have been found. Hackers used these vulnerabilities to attack the corresponding contracts developed in the blockchain system such as Ethereum, and it has caused lots of economic losses. Therefore, it is very important to find out the potential problems of the smart contracts and develop more secure smart contracts. As blockchain security events have raised more important issues, more and more smart contract security analysis methods have been developed. Most of these methods are based on traditional static analysis or dynamic analysis methods. There are only a few methods that use emerging technologies, such as machine learning. Some models that use machine learning to detect smart contract vulnerabilities cost much time in extracting features manually. In this paper, we introduce a novel machine learning-based analysis model by introducing the shared child nodes for smart contract vulnerabilities. We build the Abstract-Syntax-Tree (AST) for smart contracts with some vulnerabilities from two data sets including SmartBugs and SolidiFI-benchmark. Then, we build the Abstract-Syntax-Tree (AST) of the labeled smart contract for data sets named Smartbugs-wilds. Next, we get the shared child nodes from both of the ASTs to obtain the structural similarity, and then, we construct a feature vector composed of the values that measure structural similarity automatically to build our machine learning model. Finally, we get a KNN model that can predict eight types of vulnerabilities including Re-entrancy, Arithmetic, Access Control, Denial of Service, Unchecked Low Level Calls, Bad Randomness, Front Running, and Denial of Service. The accuracy, recall, and precision of our KNN model are all higher than 90%. In addition, compared with some other analysis tools including Oyente and SmartCheck, our model has higher accuracy. In addition, we spent less time for training .
引用
收藏
页数:12
相关论文
共 23 条
[1]  
[Anonymous], 2015, Advances in Neural Information Processing Systems (NeurIPS)
[2]  
[Anonymous], 2018, P IFIP NTMS
[3]   A Survey of Attacks on Ethereum Smart Contracts (SoK) [J].
Atzei, Nicola ;
Bartoletti, Massimo ;
Cimoli, Tiziana .
PRINCIPLES OF SECURITY AND TRUST (POST 2017), 2017, 10204 :164-186
[4]   Ethainter: A Smart Contract Security Analyzer for Composite Vulnerabilities [J].
Brent, Lexi ;
Grech, Neville ;
Lagouvardos, Sifis ;
Scholz, Bernhard ;
Smaragdakis, Yannis .
PROCEEDINGS OF THE 41ST ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '20), 2020, :454-469
[5]  
Chris D., 2017, INTRO ETHEREUM SOLID
[6]   Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts [J].
Durieux, Thomas ;
Ferreira, Joao F. ;
Abreu, Rui ;
Cruz, Pedro .
2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, :530-541
[7]   Slither: A Static Analysis Framework For Smart Contracts [J].
Feist, Josselin ;
Greico, Gustavo ;
Groce, Alex .
2019 IEEE/ACM 2ND INTERNATIONAL WORKSHOP ON EMERGING TRENDS IN SOFTWARE ENGINEERING FOR BLOCKCHAIN (WETSEB 2019), 2019, :8-15
[8]  
Hajdu A., 2019, P WORK C VER SOFTW T, P161
[9]   Learning to Fuzz from Symbolic Execution with Application to Smart Contracts [J].
He, Jingxuan ;
Balunovic, Mislay ;
Ambroladze, Nodar ;
Tsankov, Petar ;
Vechev, Martin .
PROCEEDINGS OF THE 2019 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS'19), 2019, :531-548
[10]   ContractFuzzer: Fuzzing Smart Contracts for Vulnerability Detection [J].
Jiang, Bo ;
Liu, Ye ;
Chan, W. C. .
PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, :259-269