arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2304.12645cs.SEcs.CR
收藏

揭秘以太坊智能合约中的随机数:分类体系、漏洞识别与攻击检测

Demystifying Random Number in Ethereum Smart Contract: Taxonomy, Vulnerability Identification, and Attack Detection

Peng Qian, Jianting He, Lingling Lu, Siwei Wu, Zhipeng Lu, Lei Wu, Yajin Zhou, Qinming He

AI总结:

本文系统梳理以太坊智能合约伪随机数生成原理与四类攻击,提出基于污点分析的 RNVulDet,可自动识别不良随机性漏洞并检测攻击交易,实验显示其显著优于现有工具。

摘要:

近年来,区块链智能合约应用呈现爆发式增长。随着智能合约日益普及并承载价值数万亿美元的数字资产,它们越来越成为攻击者的诱人目标;攻击者利用智能合约中的漏洞造成了灾难性的经济损失。尽管已有大量工作被开发出来,用于检测一长串令人瞩目的漏洞,但不良随机性漏洞仍被许多现有工具忽视。本文中,我们首次尝试对以太坊智能合约中的随机数进行系统分析,研究伪随机数生成背后的原理,并将其整理成一个分类体系。我们还深入研究了针对不良随机数的各种攻击,并将其归为四大类。此外,我们提出了 RNVulDet——一个融合污点分析技术的工具,用于自动识别不良随机性漏洞并检测相应的攻击交易。为全面验证 RNVulDet 的有效性,我们构建了三个新数据集:i)34个据报告存在不良随机性漏洞的知名合约;ii)214个在部署前经过严格审计、被认为不存在不良随机性漏洞的热门合约;iii)一个由47,668个智能合约和49,951笔可疑交易组成的数据集。我们将 RNVulDet 与三个最先进的智能合约漏洞检测器进行比较,结果表明我们的工具显著优于它们。同时,RNVulDet 平均每个合约耗时2.98秒,在多数情况下比其他工具快数个数量级。RNVulDet 成功揭示了44,264笔攻击交易。我们已公开实现代码和数据集,希望能启发他人。

英文摘要:

Recent years have witnessed explosive growth in blockchain smart contract applications. As smart contracts become increasingly popular and carry trillion dollars worth of digital assets, they become more of an appealing target for attackers, who have exploited vulnerabilities in smart contracts to cause catastrophic economic losses. Notwithstanding a proliferation of work that has been developed to detect an impressive list of vulnerabilities, the bad randomness vulnerability is overlooked by many existing tools. In this paper, we make the first attempt to provide a systematic analysis of random numbers in Ethereum smart contracts, by investigating the principles behind pseudo-random number generation and organizing them into a taxonomy. We also lucubrate various attacks against bad random numbers and group them into four categories. Furthermore, we present RNVulDet - a tool that incorporates taint analysis techniques to automatically identify bad randomness vulnerabilities and detect corresponding attack transactions. To extensively verify the effectiveness of RNVulDet, we construct three new datasets: i) 34 well-known contracts that are reported to possess bad randomness vulnerabilities, ii) 214 popular contracts that have been rigorously audited before launch and are regarded as free of bad randomness vulnerabilities, and iii) a dataset consisting of 47,668 smart contracts and 49,951 suspicious transactions. We compare RNVulDet with three state-of-the-art smart contract vulnerability detectors, and our tool significantly outperforms them. Meanwhile, RNVulDet spends 2.98s per contract on average, in most cases orders-of-magnitude faster than other tools. RNVulDet successfully reveals 44,264 attack transactions. Our implementation and datasets are released, hoping to inspire others.

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

↑