Smart contracts are increasingly being used to manage large numbers of high-value cryptocurrency accounts. There is a strong demand for automated, efficient, and comprehensive methods to detect security vulnerabilities in a given contract. While the literature features a plethora of analysis methods for smart contracts, the existing proposals do not address the increasing complexity of contracts. Existing analysis tools suffer from false alarms and missed bugs in today's smart contracts that are increasingly defined by complexity and interdependencies. To scale accurate analysis to modern smart contracts, we introduce EF/CF, a high-performance fuzzer for Ethereum smart contracts. In contrast to previous work, EF/CF efficiently and accurately models complex smart contract interactions, such as reentrancy and cross-contract interactions, at a very high fuzzing throughput rate. To achieve this, EF/CF transpiles smart contract bytecode into native C++ code, thereby enabling the reuse of existing, optimized fuzzing toolchains. Furthermore, EF/CF increases fuzzing efficiency by employing a structure-aware mutation engine for smart contract transaction sequences and using a contract's ABI to generate valid transaction inputs. In a comprehensive evaluation, we show that EF/CF scales better -- without compromising accuracy -- to complex contracts compared to state-of-the-art approaches, including other fuzzers, symbolic/concolic execution, and hybrid approaches. Moreover, we show that EF/CF can automatically generate transaction sequences that exploit reentrancy bugs to steal Ether.
翻译:智能合约越来越广泛地被用于管理大量高价值加密货币账户。因此需要自动化、高效、全面的方法来检测给定的合约中的安全漏洞。虽然学术文献中提出了许多智能合约的分析方法,但现有的应对方法并不能应对日益复杂的合约。已有的分析工具存在误报和错过使智能合约越来越复杂和相互依赖的漏洞。为了扩展现代智能合约的准确分析,本文介绍了一种名为 EF/CF 的以太坊智能合约高性能模糊测试工具。与先前工作不同,EF/CF 在非常高的模糊测试吞吐率下,有效准确地模拟复杂的智能合约交互,例如重入性和交叉合约交互。为了实现这一目标,EF/CF 将智能合约字节码转换为本地 C++ 代码,从而使其能够重复使用现有的优化模糊测试工具链。此外,EF/CF 通过针对智能合约交易序列的结构感知变异引擎和使用合同 ABI 生成有效的交易输入增加了模糊测试的效率。在全面评估中,我们展示了 EF/CF 相比于其他最新的方法(例如其他模糊测试工具、符号/一致执行和混合方法),具有更好的比例扩展性和更高的准确性,可应对复杂的合约。此外,我们展示了 EF/CF 可以自动生成利用重入漏洞窃取以太币的交易序列。