网络与信息安全学报 ›› 2022, Vol. 8 ›› Issue (2): 64-72.doi: 10.11959/j.issn.2096-109x.2022013

• 专栏:网络攻击与防御技术 • 上一篇    下一篇

基于以太坊状态数据库的攻击与防御方案

高镇1, 张东彬1, 田潇2   

  1. 1 天津大学电气自动化与信息工程学院,天津 300072
    2 南京慧链和信数字信息科技研究院,江苏 南京 210012
  • 修回日期:2022-02-15 出版日期:2022-04-15 发布日期:2022-04-01
  • 作者简介:高镇(1982− ),男,河北张家口人,天津大学副教授,主要研究方向为容错信号处理与区块链技术与应用
    张东彬(1998− ),男,河南平顶山人,天津大学硕士生,主要研究方向为区块链平台的安全分析
    田潇(1992− ),男,江苏南京人,南京慧链和信数字信息科技研究院工程师,主要研究方向为区块链平台的共识算法与隐私计算
  • 基金资助:
    天津市自然科学基金(19JCYBJC15700)

Defense scheme for the world state based attack in Ethereum

Zhen GAO1, Dongbin ZHANG1, Xiao TIAN2   

  1. 1 School of Electrical and Information Engineering, Tianjin University, Tianjin 300072, China
    2 Nanjing Research Institute for Huilian Digital Information Technology, Nanjing 210012, China
  • Revised:2022-02-15 Online:2022-04-15 Published:2022-04-01
  • Supported by:
    The Natural Science Foundation of Tianjin(19JCYBJC15700)

摘要:

以太坊是第二代区块链平台的典型代表,其最大特点是能够通过智能合约来支持功能丰富的分布式应用。另外,为了提高交易验证效率,以太坊使用了本地数据库来存储账户状态,并基于区块头内的状态树根保证状态数据的完整性。但是研究工作表明,本地数据库存在被篡改的安全隐患,且攻击者可以基于被篡改的账户状态发出非法交易,从而牟取不正当利益。简要描述了这类针对本地状态数据库的安全漏洞,并分析了攻击成功的前提条件;在此基础上,与工作量证明共识机制下两种常见的安全威胁进行了对比,发现在攻击者控制相同挖矿算力的条件下,基于状态数据库的攻击带来的安全风险更高,攻击成功概率趋近于 100%。为应对存在的安全威胁,提出了一套切实可行的攻击检测与防御方案,并在以太坊源码的基础上加入了二次验证与数据恢复过程。通过单机多线程的实验测试评估了所提方案的可行性与复杂度。实验结果表明:改进后的以太坊系统具备了针对状态数据库篡改的容错能力,且该方案同样适用于超级账本等其他基于本地数据库进行交易验证的区块链平台。此外,通过统计二次验证的时间和哈希计算次数,证明了所提方案带来的时间与计算开销并不显著,对现有系统的性能影响不大,具有良好的适用性。

关键词: 以太坊, 状态数据库, 状态篡改, 非法交易, 攻击检测, 攻击防御, 篡改容错

Abstract:

Ethereum is taken as the representative platform of the second generation of blockchain system.Ethereum can support development of different distributed applications by running smart contracts.Local database is used to store the account state (named world state) for efficient validation of transactions, and the state root is stored in the block header to guarantee the integrity of the state.However, some researches revealed that the local database could be easily tempered with, and attackers can issue illegal transactions based on the modified account state to obtain illegitimate benefits.This world-state based security problem was introduced, and the preconditions for attack were analyzed.Compared with the two common security threats under the PoW (proof of work) consensus, it was found that when the attacker controls the same mining computing power, the world-state based attack brought higher risk, and the success rate approached 100%.In order to deal with this threat, a practical scheme for attack detection and defense was proposed accordingly.The secondary verification and data recovery process were added to the Ethereum source code.The feasibility and complexity of the proposed scheme was evaluated with single-machine multi-threading experiments.The proposed scheme improves Ethereum’s tolerance to malicious tampering of account state, and is applicable to other blockchain platforms applying local database for transaction validation, such as Hyperledger Fabric.In addition, the time and computational overhead brought by the proposed scheme are not prominent, so it has good applicability and induces acceptable impact on the performance of original system.

Key words: Ethereum, world state, state modification, invalid transactions, attack detection, attack defense, fault tolerance to state modification

中图分类号: 

No Suggested Reading articles found!