ContractGuard: Defend Ethereum Smart Contracts with Embedded Intrusion Detection

被引:53
作者
Wang, Xinming [1 ]
He, Jiahao [2 ]
Xie, Zhijian [2 ]
Zhao, Gansen [2 ]
Cheung, Shing-Chi [3 ]
机构
[1] Lakala Grp, Bldg D1,Beiqing Rd, Beijing, Peoples R China
[2] South China Normal Univ, Sch Comp Sci, Zhongshan Rd 55, Guangzhou, Guangdong, Peoples R China
[3] Hong Kong Univ Sci & Technol, Dept Comp Sci & Engn, Kowloon, Clear Water Bay, Hong Kong, Peoples R China
基金
国家重点研发计划;
关键词
Smart contracts; Blockchain; Intrusion detection; Peer-to-peer computing; Context modeling; Runtime; ethereum smart contract; intrusion detection system; anomaly detection;
D O I
10.1109/TSC.2019.2949561
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Ethereum smart contracts are programs that can be collectively executed by a network of mutually untrusted nodes. Smart contracts handle and transfer assets of values, offering strong incentives for malicious attacks. Intrusion attacks are a popular type of malicious attacks. In this article, we propose ContractGuard, the first intrusion detection system (IDS) to defend Ethereum smart contracts against such attacks. Like IDSs for conventional programs, ContractGuard detects intrusion attempts as abnormal control flow. However, existing IDS techniques/tools are inapplicable to Ethereum smart contracts due to Ethereum's decentralized nature and its highly restrictive execution environment. To address these issues, we design ContractGuard by embedding it in the contracts to profile context-tagged acyclic paths, and optimizing it under the Ethereum gas-oriented performance model. The main goal is to minimize the overheads, to which the users will be extremely sensitive since the cost needs to be paid upfront in digital concurrency. Empirical investigation using real-life contracts deployed in the Ethereum mainnet shows that on average, ContractGuard only adds to 36.14 percent of the deployment overhead and 28.27 percent of the runtime overhead. Furthermore, we conducted controlled experiments and show that ContractGuard successfully guard against attacks on all real-world vulnerabilities and 83 percent of the seeded vulnerabilities.
引用
收藏
页码:314 / 328
页数:15
相关论文
共 43 条
[1]  
Akentiev A., 2017, Parity Multisig Hacked. AgainChain. Cloud Company BlogMedium
[2]   Improving data-flow analysis with path profiles [J].
Ammons, G ;
Larus, JR .
ACM SIGPLAN NOTICES, 1998, 33 (05) :72-84
[3]  
[Anonymous], 2004, P NETW DISTR SYST SE
[4]  
[Anonymous], SURV SOL SEC VULN
[5]  
[Anonymous], EIP150
[6]  
[Anonymous], P NETW DISTR SYST SE
[7]   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
[8]   Efficient path profiling [J].
Ball, T ;
Larus, JR .
PROCEEDINGS OF THE 29TH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE - MICRO-29, 1996, :46-57
[9]   OPTIMALLY PROFILING AND TRACING PROGRAMS [J].
BALL, T ;
LARUS, JR .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1994, 16 (04) :1319-1360
[10]  
Belazzougui D, 2009, LECT NOTES COMPUT SC, V5757, P682, DOI 10.1007/978-3-642-04128-0_61