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

SmartState:通过细粒度状态依赖分析检测智能合约中的状态回退漏洞

SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency Analysis

Zeqin Liao, Sicheng Hao, Yuhong Nan, Zibin Zheng

AI总结:

针对智能合约状态回退漏洞检测难题,提出基于细粒度状态依赖分析的SmartState框架,结合字节码与交易数据提取依赖、建模漏洞模式,在实测中取得较高准确率与召回率,还发现大量新漏洞及对应资产风险。

摘要:

用Solidity编写的智能合约被广泛应用于以太坊、TRON、BNB Chain等不同区块链平台。Solidity智能合约的独特设计之一是其用于错误处理和访问控制的状态回退机制。不幸的是,近期多起安全事件表明,攻击者也会利用该机制操纵智能合约的关键状态,进而带来非法获利、拒绝服务(DoS)等安全后果。本文将这类漏洞称为状态回退漏洞(State-reverting Vulnerability,SRV)。自动识别SRV存在独特挑战,因为这需要对智能合约中的状态依赖关系进行深入分析与理解。\n本文提出SmartState,这是一个通过细粒度状态依赖分析检测Solidity智能合约中状态回退漏洞的新框架。SmartState整合了一系列新颖机制以确保其有效性。具体而言,SmartState从合约字节码和历史交易中提取状态依赖,这两者对于推断与SRV相关的依赖都至关重要。此外,SmartState将SRV的通用模式(即获利型和DoS型)建模为SRV指标,从而基于构建的状态依赖图有效识别SRV。为评估SmartState,我们手动标注了一个包含91个真实世界SRV的真值数据集。评估结果显示,SmartState的准确率达到87.23%,召回率达到89.13%。此外,SmartState从47351个真实世界智能合约中成功识别出406个新的SRV,其中11个来自交易金额较高的热门智能合约(即排名前2000的合约)。总体而言,我们报告的SRV影响的数字资产总价值达428600美元。

英文摘要:

Smart contracts written in Solidity are widely used in different blockchain platforms such as Ethereum, TRON and BNB Chain. One of the unique designs in Solidity smart contracts is its state-reverting mechanism for error handling and access control. Unfortunately, a number of recent security incidents showed that adversaries also utilize this mechanism to manipulate critical states of smart contracts, and hence, bring security consequences such as illegal profit-gain and Deny-of-Service (DoS). In this paper, we call such vulnerabilities as the State-reverting Vulnerability (SRV). Automatically identifying SRVs poses unique challenges, as it requires an in-depth analysis and understanding of the state-dependency relations in smart contracts. This paper presents SmartState, a new framework for detecting state-reverting vulnerability in Solidity smart contracts via fine-grained state-dependency analysis. SmartState integrates a set of novel mechanisms to ensure its effectiveness. Particularly, Smart-State extracts state dependencies from both contract bytecode and historical transactions. Both of them are critical for inferring dependencies related to SRVs. Further, SmartState models the generic patterns of SRVs (i.e., profit-gain and DoS) as SRV indicators, and hence effectively identify SRVs based on the constructed state-dependency graph. To evaluate SmartState, we manually annotated a ground-truth dataset which contains 91 SRVs in the real world. Evaluation results showed that SmartState achieves a precision of 87.23% and a recall of 89.13%. In addition, SmartState successfully identifies 406 new SRVs from 47,351 real-world smart contracts. 11 of these SRVs are from popular smart contracts with high transaction amounts (i.e., top 2000). In total, our reported SRVs affect a total amount of digital assets worth 428,600 USD.

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

↑