网络与信息安全学报 ›› 2020, Vol. 6 ›› Issue (2): 35-55.doi: 10.11959/j.issn.2096-109x.2020025

• 专栏:区块链技术 • 上一篇    下一篇

ContractGuard:面向以太坊区块链智能合约的入侵检测系统

赵淦森1,2,3,谢智健1,2,3,王欣明1,2,3,4,5(),何嘉浩1,2,3,张成志5(),林成创1,2,3,ZihengZhou1,3,6,陈冰川3,7,ChunmingRong8   

  1. 1 华南师范大学计算机学院,广东 广州 510000
    2 广州市云计算安全与测评技术重点实验室,广东 广州 510000
    3 华南师范大学唯链区块链技术与应用联合实验室,广东 广州 510000
    4 拉卡拉集团,北京 100080
    5 香港科技大学,中国 香港 999077
    6 VeChain Foundation Limited,Singapore 238463
    7 广东财经大学,广东 广州 510000
    8 Stavanger University,Norway Stavanger 4036
  • 修回日期:2020-03-25 出版日期:2020-04-15 发布日期:2020-04-23
  • 作者简介:赵淦森(1977- ),男,广东东莞人,华南师范大学教授、博士生导师,主要研究方向为信息安全、区块链|谢智健(1995- ),男,广东云浮人,华南师范大学硕士生,主要研究方向为软件测试、区块链应用|王欣明(1980- ),男,香港科技大学博士生,主要研究方向为金融科技、软件测试与软件分析、区块链|何嘉浩(1995- ),男,广东广州人,华南师范大学硕士生,主要研究方向为软件分析、区块链应用|张成志(1963- ),男,中国香港人,香港科技大学教授、博士生导师,主要研究方向为软件工程|林成创(1990- ),男,广东韶关人,华南师范大学博士生,主要研究方向为计算机视觉、医疗人工智能|Ziheng Zhou(1979- ),男,新加坡人,博士,主要研究方向为区块链、共识算法、计算机视觉和机器学习|陈冰川(1975- ),男,广东财经大学讲师,主要研究方向为人工智能、推荐系统和软件工程|Chunming Rong(1969- ),男,挪威人,挪威工程院院士,挪威斯塔万格大学终身教授,主要研究方向为区块链
  • 基金资助:
    中华人民共和国香港特别行政区政府资金资助项目(RGC/GRF16202917);国家重点研发计划基金资助项目(2018YFB1404402);广东省重点研发计划基金资助项目(2019B010137003);广东省科技计划基金资助项目(2016B030305006);广东省科技计划基金资助项目(2018A07071702);广东省科技计划基金资助项目(201804010314);广东省科技计划基金资助项目(2012224-12);唯链基金会资金资助项目(SCNU-2018-01);广东省教育厅特色创新项目(自然科学)(2017KTSCX074)

ContractGuard:defend Ethereum smart contract with embedded intrusion detection

Gansen ZHAO1,2,3,Zhijian XIE1,2,3,Xinming WANG1,2,3,4,5(),Jiahao HE1,2,3,Chengzhi ZHANG5(),Chengchuang LIN1,2,3,ZHOU Ziheng1,3,6,Bingchuan CHEN3,7,RONG Chunming8   

  1. 1 South China Normal University School of Computer Science,Guangzhou 510000,China
    2 Guangzhou Key Laboratory of Cloud Computing Security and Assessment Technology,Guangzhou 510000,China
    3 VeChain blockchain technology and application joint laboratory,Guangzhou 510000,China
    4 Lakala Payment Company Limited,Beijing 100080,China
    5 HK University of Science and Technology,Hong Kong 999077,China
    6 VeChain Foundation Limited,Singapore 238463
    7 Guangdong university of finance and economics,Guangzhou 510000,China
    8 Stavanger University,Stavanger 4036,Norway
  • Revised:2020-03-25 Online:2020-04-15 Published:2020-04-23
  • Supported by:
    HKSAR(RGC/GRF16202917);The National Key R&D Program of China(2018YFB1404402);Guangdong Science &Technology Fund(2019B010137003);Guangzhou Science & Technology Fund(2016B030305006);Guangzhou Science & Technology Fund(2018A07071702);Guangzhou Science & Technology Fund(201804010314);Guangzhou Science & Technology Fund(2012224-12);VeChain Foundation(SCNU-2018-01);Guangdong Provincial Department of Education Characteristic Innovation Project (Natural Science)(2017KTSCX074)

摘要:

以太坊智能合约本质上是一种在网络上由相互间没有信任关系的节点共同执行的已被双方认证程序。目前,大量的智能合约被用于管理数字资产,使智能合约成为黑客的重要攻击对象。常见的攻击方法是通过利用智能合约的漏洞来实现特定操作的入侵攻击。ContractGuard 是首次提出面向以太坊区块链智能合约的入侵检测系统,它能检测智能合约的潜在攻击行为。ContractGuard 的入侵检测主要依赖检测潜在攻击可能引发的异常控制流来实现。由于智能合约运行在去中心化的环境以及在高度受限的环境中运行,现有的IDS技术或者工具等以外部拦截形式的部署架构不适合于以太坊智能合约。为了解决这些问题,通过设计一个嵌入式的架构,实现了把 ContractGuard 直接嵌入智能合约的执行代码中,作为智能合约的一部分。在运行时刻,ContractGuard通过相应的context-tagged无环路径来实现入侵检测,从而保护智能合约。由于嵌入了额外的代码,ContractGuard一定程度上会增加智能合约的部署开销与运行开销,为了降低这两方面的开销,基于以太坊智能合约的特性对 ContractGuard 进行优化。实验结果显示,可有效地检测 83%的异常行为,其部署开销仅增加了36.14%,运行开销仅增加了28.17%。

关键词: 区块链, 以太坊智能合约, 入侵检测系统, 异常检测

Abstract:

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.ContractGuard,the first intrusion detection system (IDS) was proposed 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 or tools are inapplicable to Ethereum smart contracts due to Ethereum’s decentralized nature and its highly restrictive execution environment.To address these issues,ContractGuard was designed by embedding it in the contracts.At runtime,ContractGuard protects the smart contract by monitoring the context-tagged acyclic path of the smart contract.As ContractGuard involves deployment overhead and deployment overhead.It was optimized under the Ethereum Gas-oriented performance model to reduce the overheads.The experimental results show that this work can effectively detect 83% of vulnerabilities,ContractGuard only adds to 36.14% of the deployment overhead and 28.27% of the runtime overhead.

Key words: blockchain, Ethereum smart contract, intrusion detection system, anomaly detection

中图分类号: 

No Suggested Reading articles found!