EVMPatch:及时自动修补以太坊智能合约
EVMPatch: Timely and Automated Patching of Ethereum Smart Contracts
摘要:
最近利用智能合约代码中的错误进行的攻击造成了毁灭性的后果,从而质疑了这项技术的好处。目前,及时修复错误并部署打了补丁的合同具有很大的挑战性。即时修补尤其重要,因为智能合约总是在线的,这是由于区块链系统的分布式性质。他们还管理着大量资产,这些资产处于危险之中,而且往往在袭击后无法恢复。升级智能合约的现有解决方案依赖于手动和容易出错的过程。本文提出了一个名为EVMPatch的框架,可以立即自动修补错误的智能合约。EVMPatch为流行的以太坊区块链提供了一个字节码重写引擎,并透明/自动地将常见的现成合同重写为可验证的合同。EVMPatch的概念验证实现自动强化了易受整数溢出/下溢和访问控制错误影响的智能合约,但可以轻松扩展以覆盖更多的bug类。我们对14,000份真实(易受攻击)合约的广泛评估表明,我们的方法成功阻止了在这些合约上发起的攻击交易,同时保持了合约的预期功能不变。我们与经验丰富的软件开发人员进行了一项研究,结果表明EVMPatch是实用的,将给定的Solidity智能合约转换为可验证合约的时间缩短了97.6%,同时确保与原始合约的功能等效。
英文摘要:
Recent attacks exploiting errors in smart contract code had devastating consequences thereby questioning the benefits of this technology. It is currently highly challenging to fix errors and deploy a patched contract in time. Instant patching is especially important since smart contracts are always online due to the distributed nature of blockchain systems. They also manage considerable amounts of assets, which are at risk and often beyond recovery after an attack. Existing solutions to upgrade smart contracts depend on manual and error-prone processes. This paper presents a framework, called EVMPatch, to instantly and automatically patch faulty smart contracts. EVMPatch features a bytecode rewriting engine for the popular Ethereum blockchain, and transparently/automatically rewrites common off-the-shelf contracts to upgradable contracts. The proof-of-concept implementation of EVMPatch automatically hardens smart contracts that are vulnerable to integer over/underflows and access control errors, but can be easily extended to cover more bug classes. Our extensive evaluation on 14,000 real-world (vulnerable) contracts demonstrate that our approach successfully blocks attack transactions launched on these contracts, while keeping the intended functionality of the contract intact. We perform a study with experienced software developers, showing that EVMPatch is practical, and reduces the time for converting a given Solidity smart contract to an upgradable contract by 97.6 %, while ensuring functional equivalence to the original contract.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。