Motivated by the immutable nature of Ethereum smart contracts and of their transactions, quite many approaches have been proposed to detect defects and security problems before smart contracts become persistent in the blockchain and they are granted control on substantial financial value. Because smart contracts source code might not be available, static analysis approaches mostly face the challenge of analysing compiled Ethereum bytecode, that is available directly from the official blockchain. However, due to the intrinsic complexity of Ethereum bytecode (especially in jump resolution), static analysis encounters significant obstacles that reduce the accuracy of exiting automated tools. This paper presents a novel static analysis algorithm based on the symbolic execution of the Ethereum operand stack that allows us to resolve jumps in Ethereum bytecode and to construct an accurate control-flow graph (CFG) of the compiled smart contracts. EtherSolve is a prototype implementation of our approach. Experimental results on a significant set of real world Ethereum smart contracts show that EtherSolve improves the accuracy of the execrated CFGs with respect to the state of the art available approaches. Many static analysis techniques are based on the CFG representation of the code and would therefore benefit from the accurate extraction of the CFG. For example, we implemented a simple extension of EtherSolve that allows to detect instances of the re-entrancy vulnerability.
翻译:由于Etheum智能合同及其交易具有不可改变的性质,因此提出了许多办法,以便在智能合同在链条中持久存在之前发现缺陷和安全问题,并允许它们控制大量的金融价值。由于智能合同源代码可能不存在,静态分析方法主要面临着分析编成的Eexeum bytecode的挑战,而Eexium bytecode直接从正式的链条中提供。然而,由于Eexium bytecode(特别是跳跃解)的内在复杂性,静态分析遇到重大障碍,降低了退出的自动工具的准确性。本文件介绍了一种新型静态分析算法,其依据是象征性地执行Etheenum 歌剧堆,从而使我们能够解决Eteenum bytecode的跳跃,并建立一个准确的智能合同控制流程图。EtherSolve是我们方法的原型执行。大量真实世界Etherum 智能合同的实验结果显示,EtherSolve在现有的艺术方法状况方面提高了弹性CFG的准确性。许多静态分析技术都以CFG的精度为基础,因此可以进行精准的提取了ERCG的演示。