Skip to content
DoS Audit finding Intermediate

Withdrawals can be locked forever if recipient is a contract

The claim function sends ETH using transfer(), which forwards only 2300 gas, so a contract wallet with a receive function needing more gas cannot claim. If a user withdraws from such a contract, the ETH becomes permanently locked in the WithdrawQueue contract.

LessDupes Follow with Bauchibred and grearlake

Originally disclosed on Code4rena

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:

payable(msg.sender).transfer(_withdrawRequest.amountToRedeem);

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.

Proof of Concept

  1. Alice calls withdraw() from her multisig wallet contract to withdraw 10 ETH worth of ezETH. The multisig contract is the msg.sender and gets saved as the withdrawal requester.
  2. After the cooldown period, Alice tries to call claim() from the multisig contract. However, the multisig has a receive() function that uses >2300 gas.
  3. When claim() executes payable(msg.sender).transfer(_withdrawRequest.amountToRedeem), the multisig’s receive() fails due to out of gas, and the transaction reverts.
  4. The 10 ETH is now permanently locked in WithdrawQueue, with no way for Alice to claim it.

Recommended Mitigation Steps

Use call() instead of transfer() to send ETH in claim():

(bool success, ) = payable(msg.sender).call{value: _withdrawRequest.amountToRedeem}("");
require(success, "ETH transfer failed");

This forwards all available gas and allows contract recipients to execute arbitrary logic.

Assessed type

ETH-Transfer

jatinj615 (Renzo) confirmed

alcueca (judge) commented:

The ruling from the Supreme Court is only consultative.

From my point of view, a bot report that can be reasonably upgraded in severity due to the specific context of the code is a valid finding. Other judges might see this differently, so this ruling shouldn’t be seen as authoritative by itself in future audits. Instead, jurisprudence should arise from a broader consensus.

The 4naly3er report states that:

The use of the deprecated transfer() function for an address may make the transaction fail

That description of impact merits a Medium severity; however, in this case the severity is higher due to the two-step withdrawal process. The withdrawal address is locked in the withdraw step, which will work fine for smart contract wallets. However, upon calling claim, the transaction will revert.

The actual impact for the sponsor would be severe. The first few users trying this would have their funds locked. Even after efforts of communication by the team, this would be an ongoing issue that would bring considerable trouble.

I’m ruling this as a valid High, and all the duplicates that mention the two-step withdrawal process as valid duplicates.

Note: For full discussion, see here.

Renzo mitigated:

The PR allows contracts like multisigs to be able to claim the withdraw request in Native ETH by sending it through call instead of transfer.

Status: Mitigation confirmed. Full details in reports from 0xCiphky, grearlake, Fassi_Security, Bauchibred, and LessDupes.


The original report as published on Code4rena, by LessDupes. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The claim function uses the deprecated transfer() method, which forwards only 2300 gas, instead of call() which forwards all available gas.

Impact

ETH withdrawn by a contract wallet that requires more than 2300 gas to receive funds becomes permanently locked in the WithdrawQueue contract, causing loss of funds.

What the attacker needed

User withdraws from a contract wallet; Contract's receive() needs >2300 gas

The fix

The claim function was changed to use call() instead of transfer() to send ETH, allowing contract recipients to receive funds.

How it was found

  1. Alice calls withdraw() from her multisig wallet contract to withdraw 10 ETH worth of ezETH.
  2. After the cooldown period, Alice tries to call claim() from the multisig contract.
  3. The claim() function executes payable(msg.sender).transfer(...), but the multisig's receive() function needs more than 2300 gas.
  4. The transaction reverts due to out of gas, and the 10 ETH remains locked in WithdrawQueue.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a smart contract sends ETH, it can use a low-level method called transfer that only gives the receiving contract a tiny amount of gas (2300) to run its code. Many contract wallets, like multisigs, need more gas to accept ETH, so the transfer fails. Because the withdrawal must be claimed by the same contract that requested it, the funds get stuck forever.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by LessDupes

View all

6 more disclosed reports, best first.

More from Renzo

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.