一句话:提出 ContractFuzzer,基于 ABI 生成输入、EVM 插桩和测试预言,检测以太坊智能合约安全漏洞。
论文针对以太坊智能合约中安全漏洞会带来重大金融损失的问题,提出 ContractFuzzer 模糊测试工具。该方法依据合约 ABI 规范生成模糊输入,定义测试预言以检测安全漏洞,并对 EVM 进行插桩来记录合约运行时行为,再分析日志报告漏洞。作者对 6991 个智能合约进行模糊测试,以较高精度标记出 459 个以上漏洞,并成功检测到导致 6000 万美元损失的 DAO 合约漏洞,以及导致 3000 万美元损失和 1.5 亿美元以太币冻结的 Parity Wallet 漏洞。
Decentralized cryptocurrencies feature the use of blockchain to transfer values among peers on networks without central agency. Smart contracts are programs running on top of the blockchain consensus protocol to enable people make agreements while minimizing trusts. Millions of smart contracts have been deployed in various decentralized applications. The security vulnerabilities within those smart contracts pose significant threats to their applications. Indeed, many critical security vulnerabilities within smart contracts on Ethereum platform have caused huge financial losses to their users. In this work, we present ContractFuzzer, a novel fuzzer to test Ethereum smart contracts for security vulnerabilities. ContractFuzzer generates fuzzing inputs based on the ABI specifications of smart contracts, defines test oracles to detect security vulnerabilities, instruments the EVM to log smart contracts runtime behaviors, and analyzes these logs to report security vulnerabilities. Our fuzzing of 6991 smart contracts has flagged more than 459 vulnerabilities with high precision. In particular, our fuzzing tool successfully detects the vulnerability of the DAO contract that leads to USD 60 million loss and the vulnerabilities of Parity Wallet that have led to the loss of USD 30 million and the freezing of USD 150 million worth of Ether.