[论文解读] Security Analysis of EOSIO Smart Contracts
该论文提出了EOSafe,这是首个针对EOSIO智能合约在WebAssembly(Wasm)字节码级别进行漏洞检测的静态分析框架。通过结合符号执行引擎、定制化的EOSIO库模拟器以及基于启发式的检测器,EOSafe在漏洞检测中实现了98%的F1值,并识别出53,666个活跃EOSIO智能合约中超过25%存在漏洞,其中48起已确认的现实世界攻击导致至少170万美元的损失。
The EOSIO blockchain, one of the representative Delegated Proof-of-Stake (DPoS) blockchain platforms, has grown rapidly recently. Meanwhile, a number of vulnerabilities and high-profile attacks against top EOSIO DApps and their smart contracts have also been discovered and observed in the wild, resulting in serious financial damages. Most of EOSIO's smart contracts are not open-sourced and they are typically compiled to WebAssembly (Wasm) bytecode, thus making it challenging to analyze and detect the presence of possible vulnerabilities. In this paper, we propose EOSAFE, the first static analysis framework that can be used to automatically detect vulnerabilities in EOSIO smart contracts at the bytecode level. Our framework includes a practical symbolic execution engine for Wasm, a customized library emulator for EOSIO smart contracts, and four heuristics-driven detectors to identify the presence of four most popular vulnerabilities in EOSIO smart contracts. Experiment results suggest that EOSAFE achieves promising results in detecting vulnerabilities, with an F1-measure of 98%. We have applied EOSAFE to all active 53,666 smart contracts in the ecosystem (as of November 15, 2019). Our results show that over 25% of the smart contracts are vulnerable. We further analyze possible exploitation attempts against these vulnerable smart contracts and identify 48 in-the-wild attacks (25 of them have been confirmed by DApp developers), resulting in financial loss of at least 1.7 million USD.
研究动机与目标
- 为解决缺乏自动化分析EOSIO智能合约的工具问题,这些合约通常被编译为Wasm且未公开源代码。
- 克服因Wasm字节码具有复杂指令集、嵌套控制流以及对语义上下文需求而带来的分析挑战。
- 自动且准确地检测四种高影响力EOSIO特有漏洞——虚假EOS、虚假收据、回滚攻击以及权限检查缺失。
- 大规模评估整个EOSIO生态系统的安全状况,识别真实世界中的利用尝试。
提出的方法
- 设计并实现一个专用于Wasm字节码的符号执行引擎,采用启发式路径剪枝技术以缓解路径爆炸问题。
- 开发一个定制化的库模拟器,用于模拟EOSIO特定函数和数据结构,这些对漏洞检测至关重要。
- 构建一个基于插件的漏洞检测框架,支持插入针对特定漏洞模式的检测器。
- 实现四个基于启发式的检测器,用于检测四种最普遍的EOSIO漏洞,利用对Wasm控制流和函数参数的语义分析。
- 将符号执行与模拟器集成,以探索程序路径,并基于控制流和数据流分析识别安全缺陷。
- 将该框架应用于截至2019年11月15日的全部53,666个活跃EOSIO智能合约,实现大规模漏洞度量。
实验结果
研究问题
- RQ1当EOSIO智能合约被编译为Wasm且未公开源代码时,静态分析框架能否有效检测其漏洞?
- RQ2结合路径剪枝的符号执行在分析具有嵌套控制流和高级指令的复杂Wasm字节码时效果如何?
- RQ3像虚假EOS和虚假收据这类已知高影响力漏洞在EOSIO生态系统中普遍存在到何种程度?
- RQ4该框架能否识别出真实世界中的利用尝试?此类攻击的金融影响规模如何?
主要发现
- 在人工构建的52个智能合约基准测试中,EOSafe实现了98%的F1值,表明其具有高精度和高召回率。
- 在分析的53,666个活跃EOSIO智能合约中,超过25%存在至少一种目标漏洞。
- 该框架识别出48起现实世界攻击,其中25起已由DApp开发者确认,导致至少170万美元的金融损失。
- 研究发现,许多存在漏洞的合约处于非活跃状态或余额较低,表明攻击者可能选择性地针对高价值合约。
- 符号执行引擎通过启发式剪枝成功缓解了路径爆炸问题,实现了对复杂Wasm智能合约的可扩展分析。
- 该框架的模块化设计支持扩展以检测更多漏洞,且可泛化应用于其他基于Wasm的系统,而不仅限于EOSIO。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。