Submitted by LessDupes, also found by Bauchibred and grearlake
The WithdrawQueue contract allows users to request withdrawals of their ezETH tokens in exchange for a selected asset, such as ETH or an ERC20 token. After a cooldown period, users can call the claim() function to receive their withdrawn assets.
When the selected asset is ETH, the claim() function sends the ETH using the low-level transfer() function:
However, transfer() only forwards 2300 gas, which is not enough for the recipient to execute any non-trivial logic in a receive() or fallback function. For instance, it is not enough for Safes (such as this one in use by the protocol) to receive funds, which require > 6k gas for the call to reach the implementation contract and emit an event:
Note: to view the provided image, please see the original submission here.
In this case, the impact is higher than that reported by 4naly3er because claim() requires the caller to be the same address that initiated the original withdrawal request via withdraw().
If a user calls withdraw() from a contract account like a multisig or smart contract wallet that has a receive() function requiring >2300 gas, their subsequent claim() call will fail permanently. The withdrawn ETH will be locked in the WithdrawQueue contract forever, leading to loss of funds.
Use call() instead of transfer() to send ETH in claim():
This forwards all available gas and allows contract recipients to execute arbitrary logic.
ETH-Transfer
jatinj615 (Renzo) confirmed
alcueca (judge) commented:
Note: For full discussion, see here.
Renzo mitigated:
Status: Mitigation confirmed. Full details in reports from 0xCiphky, grearlake, Fassi_Security, Bauchibred, and LessDupes.
