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

Penny Wise and Pound Foolish:量化以太坊上无限制批准ERC20代币的风险

Penny Wise and Pound Foolish: Quantifying the Risk of Unlimited Approval of ERC20 Tokens on Ethereum

Dabao Wang, Hang Feng, Siwei Wu, Yajin Zhou, Lei Wu, Xingliang Yuan

摘要:

去中心化金融的繁荣促使许多投资者通过在以太坊生态系统的去中心化应用程序(简称DApps)上交易他们的加密资产来获利。除了Ether(以太坊的原生加密货币),许多ERC 20(以太坊上广泛使用的代币标准)代币在生态系统中获得了巨大的市场价值。具体来说,批准机制用于将花费用户令牌的权限委托给DApp。通过这样做,DApp可以代表用户将这些令牌传输给任意接收者。为了提高可用性,DApp通常采用无限制的批准,以减少它们与用户之间所需的交互。然而,正如现有的安全事件所示,这种机制可以被滥用来窃取用户的令牌。在本文中,我们提出了第一个系统性的研究,以量化以太坊上ERC 20代币无限制批准的风险。具体来说,通过评估截至2021年7月31日的现有交易,我们发现生态系统中普遍存在无限制批准(60%,15.2 M/25.4 M),并且22%的用户的批准代币被盗风险很高。在此之后,我们调查了与22个代表性DApp和9个著名钱包的UI交互以准备批准交易所涉及的安全问题。结果揭示了一个令人担忧的事实,即所有DApp都要求前端用户无限制地批准,只有10%(3/31)的UI提供了批准机制的解释信息。与此同时,只有16%(5/31)的UI允许用户修改其批准金额。最后,我们进一步将用户行为描述为五种模式,并将良好实践形式化,即,按需批准和及时支出,以安全地支出批准的令牌。然而,评估结果表明,只有0.2%的用户遵循良好做法来降低风险。

英文摘要:

The prosperity of decentralized finance motivates many investors to profit via trading their crypto assets on decentralized applications (DApps for short) of the Ethereum ecosystem. Apart from Ether (the native cryptocurrency of Ethereum), many ERC20 (a widely used token standard on Ethereum) tokens obtain vast market value in the ecosystem. Specifically, the approval mechanism is used to delegate the privilege of spending users' tokens to DApps. By doing so, the DApps can transfer these tokens to arbitrary receivers on behalf of the users. To increase the usability, unlimited approval is commonly adopted by DApps to reduce the required interaction between them and their users. However, as shown in existing security incidents, this mechanism can be abused to steal users' tokens. In this paper, we present the first systematic study to quantify the risk of unlimited approval of ERC20 tokens on Ethereum. Specifically, by evaluating existing transactions up to 31st July 2021, we find that unlimited approval is prevalent (60%, 15.2M/25.4M) in the ecosystem, and 22% of users have a high risk of their approved tokens for stealing. After that, we investigate the security issues that are involved in interacting with the UIs of 22 representative DApps and 9 famous wallets to prepare the approval transactions. The result reveals the worrisome fact that all DApps request unlimited approval from the front-end users and only 10% (3/31) of UIs provide explanatory information for the approval mechanism. Meanwhile, only 16% (5/31) of UIs allow users to modify their approval amounts. Finally, we take a further step to characterize the user behavior into five modes and formalize the good practice, i.e., on-demand approval and timely spending, towards securely spending approved tokens. However, the evaluation result suggests that only 0.2% of users follow the good practice to mitigate the risk.

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

↑