Skip to content
DoS Audit finding Intermediate

ETH withdrawals from EigenLayer always fail due to OperatorDelegator ’s nonReentrant receive()

The OperatorDelegator contract's receive() function is marked nonReentrant, but it is called during completeQueuedWithdrawal() when ETH is withdrawn from EigenLayer, causing the reentrancy guard to block the legitimate callback. As a result, all withdrawals that include ETH become permanently stuck in EigenLayer and cannot be redeemed.

LessDupes Follow with blutorque, ilchovski and 4 others

Originally disclosed on Code4rena

Submitted by LessDupes, also found by blutorque, ilchovski, 0x73696d616f, zzykxx, kennedy1030, and KupiaSec

https://github.com/code-423n4/2024-04-renzo/blob/519e518f2d8dec9acf6482b84a181e403070d22d/contracts/Delegation/OperatorDelegator.sol#L269

https://github.com/code-423n4/2024-04-renzo/blob/519e518f2d8dec9acf6482b84a181e403070d22d/contracts/Delegation/OperatorDelegator.sol#L501

Vulnerability details

The OperatorDelegator.completeQueuedWithdrawal() function is used by admins to finalize previously initiated withdraws of shares from EigenLayer.

We note that both this and the OperatorDelegator’s receive() functions are nonReentrant:

File: OperatorDelegator.sol
265:     function completeQueuedWithdrawal(
266:         IDelegationManager.Withdrawal calldata withdrawal,
267:         IERC20[] calldata tokens,
268:         uint256 middlewareTimesIndex
269:     ) external nonReentrant onlyNativeEthRestakeAdmin {
270:         uint256 gasBefore = gasleft();
271:         if (tokens.length != withdrawal.strategies.length) revert MismatchedArrayLengths();
272:
273:         // complete the queued withdrawal from EigenLayer with receiveAsToken set to true
274:         delegationManager.completeQueuedWithdrawal(withdrawal, tokens, middlewareTimesIndex, true);
---
501:     receive() external payable nonReentrant {
502:         // check if sender contract is EigenPod. forward full withdrawal eth received
503:         if (msg.sender == address(eigenPod)) {
504:             restakeManager.depositQueue().forwardFullWithdrawalETH{ value: msg.value }();

However, the receive() function is normally called by the EigenPod in the call stack originated by the L274 completeQueuedWithdrawal() when receiveAsTokens == true like in this case. This particular instance of reentrancy is not only acceptable but also required to allow ETH redemptions from EigenLayer. However, the nonReentrant modifier prevents it.

Impact

All withdrawals that include any amount of ETH will be permanently stuck in EigenLayer and won’t be redeemable. Only amounts coming from new deposits can be redeemed and the team will have no way to fill the withdrawal queues. To unblock them, the team will necessarily have to upgrade OperatorDelegator.

Proof of Concept

To prove the concept, it’s sufficient to upgrade OperatorDelegator on a mainnet fork and initiate a withdrawal that has ETH among the withdrawn strategies.

While it would be too bulky to provide a coded PoC, you can find in this GH Gist the Foundry traces of such failed call on a mainnet fork.

Tools Used

Foundry

Recommended Mitigation Steps

Consider removing nonReentrant from OperatorDelegator’s receive, or applying the modifier only in case msg.sender != eigenPod.

Assessed type

Reentrancy

jatinj615 (Renzo) confirmed via duplicate Issue #571

Renzo mitigated

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 receive() function is marked nonReentrant, which prevents the legitimate callback from EigenPod during completeQueuedWithdrawal() when ETH is withdrawn.

What the attacker needed

Withdrawal includes ETH; admin initiates completeQueuedWithdrawal

The fix

The nonReentrant modifier should be removed from receive(), or applied only when msg.sender is not the EigenPod.

How it was found

  1. Upgrade OperatorDelegator on a mainnet fork.
  2. Initiate a withdrawal that includes ETH among the withdrawn strategies.
  3. Observe that the withdrawal fails because receive() is blocked by nonReentrant.

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.

A smart contract can have a special function that runs automatically when it receives cryptocurrency. Here, that function was locked so it could not run while another function was still executing, but the withdrawal process needed it to run at that exact moment. Because the lock blocked the required call, the withdrawal could never finish and the funds stayed stuck.

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.