arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.10169cs.SE
收藏

智能合约中中心化缺陷的定义与检测

Definition and Detection of Centralization Defects in Smart Contracts

Zewei Lin, Jiachi Chen, Jiajing Wu, Weizhe Zhang, Zibin Zheng

AI总结:

本文针对智能合约中心化缺陷问题,通过分析帖子和审计报告定义六类缺陷,并提出基于权限依赖图的检测工具CDRipper,在244,424个合约中实现93.7%精确度。

摘要:

近年来,源于智能合约中心化缺陷的安全事件导致了巨额财务损失。中心化缺陷是指在智能合约设计或开发阶段引入单点故障的任何错误、瑕疵或故障。此类缺陷允许特定账户或用户中断智能合约的正常运行,可能导致故障甚至项目彻底停摆。尽管该问题意义重大,但目前大多数智能合约分析忽视了中心化缺陷,主要关注其他类型的缺陷。为填补这一空白,本文通过手动分析597篇Stack Exchange帖子和117份审计报告,引入了六类智能合约中心化缺陷。对于每类缺陷,我们提供了详细描述和代码示例,以说明其特征与潜在影响。此外,我们介绍了一款名为CDRipper(Centralization Defects Ripper)的工具,旨在识别所定义的中心化缺陷。具体而言,CDRipper构建权限依赖图(PDG),并从智能合约源代码中提取函数的权限依赖关系。随后,它检测函数中的敏感操作,并基于预定义模式识别中心化缺陷。我们使用CDRipper对244,424个真实世界的智能合约进行了大规模实验,并基于人工标注的数据集评估结果。研究结果显示,82,446个合约至少包含六种中心化缺陷之一,工具整体精确度达93.7%。

英文摘要:

In recent years, security incidents stemming from centralization defects in smart contracts have led to substantial financial losses. A centralization defect refers to any error, flaw, or fault in a smart contract's design or development stage that introduces a single point of failure. Such defects allow a specific account or user to disrupt the normal operations of smart contracts, potentially causing malfunctions or even complete project shutdowns. Despite the significance of this issue, most current smart contract analyses overlook centralization defects, focusing primarily on other types of defects. To address this gap, our paper introduces six types of centralization defects in smart contracts by manually analyzing 597 Stack Exchange posts and 117 audit reports. For each defect, we provide a detailed description and code examples to illustrate its characteristics and potential impacts. Additionally, we introduce a tool named CDRipper (Centralization Defects Ripper) designed to identify the defined centralization defects. Specifically, CDRipper constructs a permission dependency graph (PDG) and extracts the permission dependencies of functions from the source code of smart contracts. It then detects the sensitive operations in functions and identifies centralization defects based on predefined patterns. We conduct a large-scale experiment using CDRipper on 244,424 real-world smart contracts and evaluate the results based on a manually labeled dataset. Our findings reveal that 82,446 contracts contain at least one of the six centralization defects, with our tool achieving an overall precision of 93.7%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑