[论文解读] DAppSCAN: Building Large-Scale Datasets for Smart Contract Weaknesses in DApp Projects
本论文提出了 DAppSCAN,一个大规模、真实世界的数据集,包含从 682 个去中心化应用(DApps)中提取的 1,618 个 SWC 列表的智能合约弱点。基于对 1,199 份审计报告(历时 44 人月)的分析,作者构建了两个数据集——DAppSCAN-Source(39,904 个 Solidity 文件)和 DAppSCAN-Bytecode(6,665 个编译后的合约),以支持对智能合约分析工具的真实评估,结果表明现有工具在真实 DApp 代码上的表现较差。
The Smart Contract Weakness Classification Registry (SWC Registry) is a widely recognized list of smart contract weaknesses specific to the Ethereum platform. Despite the SWC Registry not being updated with new entries since 2020, the sustained development of smart contract analysis tools for detecting SWC-listed weaknesses highlights their ongoing significance in the field. However, evaluating these tools has proven challenging due to the absence of a large, unbiased, real-world dataset. To address this problem, we aim to build a large-scale SWC weakness dataset from real-world DApp projects. We recruited 22 participants and spent 44 person-months analyzing 1,199 open-source audit reports from 29 security teams. In total, we identified 9,154 weaknesses and developed two distinct datasets, i.e., DAPPSCAN-SOURCE and DAPPSCAN-BYTECODE. The DAPPSCAN-SOURCE dataset comprises 39,904 Solidity files, featuring 1,618 SWC weaknesses sourced from 682 real-world DApp projects. However, the Solidity files in this dataset may not be directly compilable for further analysis. To facilitate automated analysis, we developed a tool capable of automatically identifying dependency relationships within DApp projects and completing missing public libraries. Using this tool, we created DAPPSCAN-BYTECODE dataset, which consists of 6,665 compiled smart contract with 888 SWC weaknesses. Based on DAPPSCAN-BYTECODE, we conducted an empirical study to evaluate the performance of state-of-the-art smart contract weakness detection tools. The evaluation results revealed sub-par performance for these tools in terms of both effectiveness and success detection rate, indicating that future development should prioritize real-world datasets over simplistic toy contracts.
研究动机与目标
- 解决当前缺乏大规模、无偏见、真实世界数据集以评估智能合约弱点检测工具的问题。
- 克服现有评估方法依赖小规模、合成或玩具合约所带来的局限性,这些合约与真实世界的相关性有限。
- 基于 29 个安全团队的审计报告,创建一个全面的手动整理的、来自真实 DApp 项目的真实智能合约漏洞数据集。
- 开发一个工具,自动解析依赖关系并将 DApp 项目编译为可执行字节码,以支持自动化分析。
- 在真实世界 DApp 代码上评估最先进工具的性能,揭示当前检测能力中的差距。
提出的方法
- 招募 22 名研究人员(7 名博士,15 名硕士)在 44 人月内手动分析 1,199 份来自 29 个安全团队的开源审计报告。
- 识别出总计 9,154 个弱点,其中 1,618 个映射到 SWC 注册表类别,包含精确的源代码位置和描述。
- 构建 DAppSCAN-Source:来自 682 个真实 DApp 项目的 39,904 个 Solidity 文件,保留原始代码结构和漏洞上下文。
- 开发依赖关系解析工具,自动检测并解决 DApp 项目中缺失的公共库,以支持编译。
- 生成 DAppSCAN-Bytecode:6,665 个编译后的智能合约,包含 888 个 SWC 弱点,适用于字节码级别分析。
- 对六种最先进工具在 DAppSCAN-Bytecode 上进行实证评估,以衡量其检测效果和成功率。
实验结果
研究问题
- RQ1当在真实世界 DApp 代码上评估时,当前智能合约分析工具在检测 SWC 列表弱点方面的有效性如何?
- RQ2SWC 弱点在真实世界 DApp 项目中的分布与频率如何?与玩具合约相比有何差异?
- RQ3现有工具在多大程度上检测出真实 DApp 部署中的可利用漏洞?哪些类型的弱点最常被遗漏?
- RQ4依赖关系解析和编译完整性在多大程度上影响了对 DApp 级项目自动化漏洞检测的可靠性?
- RQ5当应用于复杂的真实世界 DApp 架构而非孤立合约时,当前工具的关键局限性是什么?
主要发现
- DAppSCAN-Source 数据集包含来自 682 个真实 DApp 项目的 39,904 个 Solidity 文件,平均每个 DApp 包含 58 个合约文件和 7,885 行代码。
- 该数据集中 66.3% 的 DApp 使用高于 0.6 版本的 Solidity 编译器,反映了现代开发实践。
- DAppSCAN-Bytecode 数据集包含 6,665 个编译后的智能合约,其中包含 888 个 SWC 弱点,支持可执行分析。
- 实证评估显示,最先进工具在真实 DApp 代码上的有效性和检测成功率均表现不佳。
- 在数据集中 23,327 个存在漏洞的合约中,仅有 463 个(1.98%)在实际中被利用,表明学术工具中存在较高的误报率或非可利用问题。
- 现有工具未能检测出大量真实世界中可利用的漏洞,特别是逻辑错误和协议层缺陷,凸显了当前检测能力中的关键差距。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。