[论文解读] SmartBugs: A Framework to Analyze Solidity Smart Contracts
SmartBugs 是一个开源、可扩展的框架,用于在 Solidity 智能合约上标准化静态分析工具的执行与比较。通过提供预配置的工具、经过筛选的数据集以及基于 Docker 的执行环境,它实现了可复现的评估;在 SmartBugs 内部扩展 SmartCheck 后,对 Bad Randomness、Time Manipulation 和 Access Control 三类漏洞的检测率从 11% 提升至 24%。
Over the last few years, there has been substantial research on automated analysis, testing, and debugging of Ethereum smart contracts. However, it is not trivial to compare and reproduce that research. To address this, we present SmartBugs, an extensible and easy-to-use execution framework that simplifies the execution of analysis tools on smart contracts written in Solidity, the primary language used in Ethereum. SmartBugs is currently distributed with support for 10 tools and two datasets of Solidity contracts. The first dataset can be used to evaluate the precision of analysis tools, as it contains 143 annotated vulnerable contracts with 208 tagged vulnerabilities. The second dataset contains 47,518 unique contracts collected through Etherscan. We discuss how SmartBugs supported the largest experimental setup to date both in the number of tools and in execution time. Moreover, we show how it enables easy integration and comparison of analysis tools by presenting a new extension to the tool SmartCheck that improves substantially the detection of vulnerabilities related to the DASP10 categories Bad Randomness, Time Manipulation, and Access Control (identified vulnerabilities increased from 11% to 24%).
研究动机与目标
- 解决智能合约分析研究中因数据集和工具配置不一致而导致的可复现性不足问题。
- 提供一个统一、可扩展的框架,以简化对 Solidity 合约上静态分析工具的执行与比较。
- 使研究人员和实践者能够使用标准化、带注释的数据集,一致地评估工具。
- 通过模块化配置和基于 Docker 的部署,促进新工具和扩展的集成。
- 通过简化在多个工具和合约集之间的执行流程,支持大规模经验评估。
提出的方法
- 设计一个模块化框架,包含命令行接口、工具配置文件、工具的 Docker 镜像以及专用数据集。
- 将 10 个现有的静态分析工具(例如 Slither、Mythril、SmartCheck)与特定版本的配置集成,以处理 Solidity 的向后兼容性问题。
- 提供两个数据集:一个包含 143 个存在漏洞的合约、共 208 个带标签漏洞(10 个类别)的筛选数据集,以及一个从 Etherscan 收集的 47,518 个合约的更大数据集。
- 使用基于 YAML 的配置文件定义工具行为,包括默认和旧版 Solidity 版本的支持。
- 实现 SmartBugs Runner,通过 Docker 容器在数据集上编排多个工具的执行。
- 在 SmartCheck 中扩展新的基于 XPath 的规则,用于检测不良随机性、时间操纵以及未受保护的访问控制模式。
实验结果
研究问题
- RQ1标准化框架能否提升智能合约分析研究中的可复现性?
- RQ2SmartBugs 在支持大规模、跨工具的静态分析工具评估方面效果如何?
- RQ3在 SmartBugs 内部对工具进行集成与扩展,能在多大程度上提升漏洞检测的精度?
- RQ4能否有效向现有工具(如 SmartCheck)添加新规则,以增强对特定漏洞类别的检测能力?
- RQ5在共享的、带注释的数据集上,扩展后工具的性能和准确性与原始版本相比如何?
主要发现
- SmartBugs 支持了迄今为止最大的实验设置,涵盖 10 个工具,并在多个合约集合上实现了长时间的广泛执行。
- 在 SmartBugs 内部扩展 SmartCheck 后,对 DASP10 类别中 Bad Randomness、Time Manipulation 和 Access Control 漏洞的检测率从 11% 提升至 24%。
- 扩展后的 SmartCheck 工具在 115 个存在漏洞的筛选合约数据集中检测到 15 个新增漏洞(总计 28 个,而原始 SmartCheck 仅检测到 13 个)。
- 针对 Bad Randomness 的新规则检测到了 31 个漏洞中的 10 个(32%),显著优于原始工具的 0% 检测率。
- 在 Time Manipulation 类别中,检测率从 1/5(20%)提升至 4/5(80%),得益于扩展规则。
- 通过增加针对未受保护的 selfdestruct 和所有权转移模式的规则,Access Control 类别的检测率从 2/19(11%)提升至 4/19(21%)。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。