深度还原 7702 钓鱼攻击原理,钱包和用户该如何防范?

深潮Published on 2025-06-04Last updated on 2025-06-04

在使用任何钱包进行签名时,请仔细看清签名内容,避免盲签或误签。

EIP-7702赋予了地址类似智能合约的能力和灵活性,越来越多的7702应用正在不断被创造出来,这对让更多的人进入Web3和提高用户体验至关重要。

然而,7702的灵活性以及大多数用户对7702还不熟悉的现状正在被欺诈团伙利用,近期我们观测到有用户就因为 Metamask 7702 批量执行的能力而导致原本需要授权十几次的交互,被钓鱼团伙 #InfernoDrainer 合并成一笔交易完成,导致资产被盗。

说明:Metamask 本身没有安全问题,Metamask在为用户提供7702相关能力时是把用户安全放在第一位的,并且做了很多安全措施。用户需要对7702的能力和相关风险了解更多,以防止此类安全事件再次发生。

一、Metamask 7702 Delagator签名授权原理与安全设计

1. 技术分析

  • 由用户授权已部署的Delegator Contract,将用户账户的code字段指向该合约。当前MetaMask官方Delegator Contract地址:0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B

  • 授权结构:(chainId, delegatorAddress, nonce, signature)写入authorization_list

  • 签名方式:Metamask底层对EIP-7702相关的授权交易采用统一的签名逻辑,即signEIP7702Authorization方法,对授权数据digest7702 = keccak256(0x05 ‖ RLP(chainId, delegator, nonce))进行 ECDSA 签名,生成(v, r, s)签名结构,并附加到随后的 Type-4 交易中,实现账户的授权与升级,具体实现见:https://github.com/MetaMask/eth-sig-util/blob/main/src/sign-eip7702-authorization.ts

  • 验证方式:共识层通过ecrecover(digest7702, sig) == tx.from完成验证。

  • 安全设计:网页端无法诱导用户对任意的Delegator进行授权,因为signEIP7702Authorization方法仅在 MetaMask 钱包内部实现,不通过 window.ethereum对网页端开放调用**。**网页可访问的签名方法如 eth_signTypedData_v4并不适用于 EIP-7702 授权签名,其签名摘要格式如下:

而 EIP-7702 规范要求的签名格式为:

由于 eth_signTypedData_v4固定包含 0x1901前缀,且摘要计算过程与 7702 完全不同,因此即使构造巧妙的 domainSeparatorprimaryTypemessage,也几乎不可能使得 digest712 == digest7702

因此,网页端无法通过该方法伪造合法的 7702 授权签名。此外,MetaMask 还对 Delegator 地址实行白名单机制,默认且仅允许授权官方 Delegator(0x63c0...32B),禁止 DApp 自行注入地址,进一步防止用户被诱导签名恶意 Delegator 授权数据。

2. 使用方法

当前在 Metamask 中,将现有 EOA 升级为7702智能账户(Smart Account)的方式主要分为两类:主动升级与被动升级。

主动升级是指用户在钱包界面主动点击“切换”按钮,授权特定的 Delegator Contract。

被动升级则发生在用户与某些支持 7702 的 DApp 交互时,Metamask 检测到相关操作后会自动弹出提示,建议用户完成升级。

2.1 主动升级:

  • 交易内容:仅包括升级改账户的动作,即授权特定的Delegator Contract。

  • 升级流程:进入钱包的账户详情界面,点击下图中的切换按钮,即可将用户在Ethereum Mainnet升级为智能账户。点击切换之后,出现用户签名当前升级交易窗口:

  • 授权记录:确认后,等待交易上链,上链成功意味着用户成功升级为智能账户,可以从etherscan上当前钱包地址的页面中的**Authorizations (EIP-7702)**查看具体的授权交易信息。

2.2 被动升级

  • 交易内容:包括升级账户的动作以及与链上合约交互的批量动作。

  • 升级流程:在用户与链上某些DApp交互时,Metamask会主动提示用户当前交易可以通过升级成智能账户使用批量发送的方式来完成.例如在Uniswap上进行某些token的swap,点击Use smart account 按钮,升级成智能账户,之后代币授权和Swap将在一笔交易中批量完成。

2.3 切换回普通EOA

无论采用主动升级还是被动升级的方式将当前账户转换为智能账户,其绑定的 Delegator Contract 地址都会永久存储在链上,作为账户当前的执行逻辑。

若用户希望将账户恢复为普通 EOA,需要手动发起一次“切换回 EOA”的操作。该操作的本质是:通过一次 EIP-7702 授权,将address(0)作为新的 Delegator 合约地址提交。当该交易成功上链后,账户的code字段将被清空,执行逻辑恢复为默认的空代码,账户即回退为普通 EOA 状态。

进入钱包的账户详情界面,点击切换按钮,即可将用户在Ethereum Mainnet切换回普通EOA账户。

点击确认后,等待交易上链,上链成功意味着用户已经从智能账户切换回了普通的EOA账户,具体的交易信息同样可以在etherscan上当前钱包地址页面中找到。

二、7702 钓鱼攻击实例

5月24日,#InfernoDrainer 钓鱼团伙利用 Metamask 7702-Delagator 合约的批量执行功能批量骗取了用户(0xc6D2…06DC)的代币授权,并实施了钓鱼攻击,损失超14.6万美元的 $HashAI $HUMANS $ParallelAI $NeuralAI $DSync $Zero1 $NodeAI $Sensay $Virtual.

  • 欺诈地址

0x0000db5c8B030ae20308ac975898E09741e70000 0x00008C22F9F6f3101533f520e229BbB54Be90000 0xa85d90B8Febc092E11E75Bf8F93a7090E2ed04DE 0xC83De81A2aa92640D8d68ddf3Fc6b4B853D77359 0x33dAD2bbb03Dca73a3d92FC2413A1F8D09c34181

  • 钓鱼交易示例

https://etherscan.io/tx/0x09c264618e93983510aaeb7aa2c91c8254a8b2ec66167438f3f6c28b866b6eba

  • 被钓鱼原因

用户(0xc6D2…06DC)执行了恶意批量授权交易:

Ethereum Transaction Hash: 0x1ddc8cecbc... | Etherscan

Call 0xe9ae5c53 Method By 0xc6D289d5...0d2E606DC on 0xc6D289d5...0d2E606DC | Success | May-23-2025 02:31:35 PM (UTC)

etherscan.io

  • #InfernoDrainer 和 #PinkDrainer 正在实验更隐蔽、影响更大的利用7702的钓鱼黑色产业链。

根据我们的研究,目前钓鱼黑产团伙 #InfernoDrainer 和 #PinkDrainer 都正在研究并实验更隐蔽、影响更大的利用7702的钓鱼黑色产业链,相关地址如下,我们也将在后续公布更详细的报告:

Inferno Drainer:

0x0000db5c8B030ae20308ac975898E09741e70000

Pink Drainer:

0xe49e04F40C272F405eCB9a668a73EEAD4b3B5624

三、安全建议

钱包提供商:

  • 参考Metamask对于7702 Delegator的实现和安全管理,禁止用户对任意的Delegator授权,并且只允许应用内操作。提醒用户任何通过网页让用户进行签名授权的行为都是钓鱼攻击。

  • 检查链是否与当前网络匹配,并提醒用户使用 chainID 为 0 签名时存在重放风险。

  • 在用户签名授权时显示目标合约,在用户通过Delegator进行批量执行时显示具体的函数调用内容,降低网络钓鱼攻击的风险。

用户:

  • 私钥保护始终是最重要的。Not your keys, not your coins.

  • 不要根据任何独立的网页进行Delegator授权,安全的授权通常只会像Metamask一样在应用内进行。

  • 在使用任何钱包进行签名时,请仔细看清签名内容,避免盲签或误签。

Related Reads

The Domestic Answer to Space Computing Power: Photonics Are More Efficient, Musk and Huang's Approaches Are Too Roundabout

The Space Computing Race: A Photonic Advantage The competition for space-based computing has intensified, with figures like Elon Musk and NVIDIA's Jensen Huang highlighting its potential. Musk predicts solar-powered AI satellites could offer the most cost-effective computing by 2032. However, space presents extreme challenges for traditional electronic chips: radiation from cosmic particles can cause errors, the vacuum environment hinders heat dissipation, and limited solar power constrains energy-hungry systems. Photonic computing, using light instead of electrons, offers a promising solution. Its core advantages for space are threefold: 1) **Radiation Resistance**: Photons are charge-neutral, making them inherently immune to particle interference. 2) **Low Heat Generation**: Light propagation in waveguides generates minimal heat, bypassing critical thermal management issues. 3) **Low Power Consumption**: Photonic chips have near-zero static power draw, aligning perfectly with the energy constraints of satellites. Furthermore, for a given payload weight and volume, photonic systems can potentially deliver higher total compute density. Since they require less bulky cooling and power infrastructure, more space can be allocated to the compute units themselves. While photonic computing holds great promise, current industry approaches face hurdles like the memory-compute bottleneck (separate storage and processing) and challenges in large-scale integration. Engineering for space—withstanding launch vibrations and validating full system operation in orbit—remains a critical step. The path forward resembles the evolution from single GPUs to computing clusters, but via a photonic route. As electronic chips approach physical limits in miniaturization, photonic computing and optical interconnects (光算光联) may provide a key alternative to bypass these constraints and define the next generation of space-based computing capabilities.

marsbit34m ago

The Domestic Answer to Space Computing Power: Photonics Are More Efficient, Musk and Huang's Approaches Are Too Roundabout

marsbit34m ago

Trading

Spot
活动图片