Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

almurhasan - Calling function queueWithdrawalForUserSettlement will revert. #160

Closed
sherlock-admin opened this issue Mar 7, 2024 · 4 comments
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 7, 2024

almurhasan

high

Calling function queueWithdrawalForUserSettlement will revert.

Summary

This function will revert due to a require statement in eigenlayer’s delegationmanager contract.the statement is withdrawer must be staker.but here withdrawer is not staker.

Vulnerability Detail

  1. Let assume the function queueWithdrawalForUserSettlement is called by Coordinator contract for user settlement.
  2. This function calls the _queueWithdrawal function i.e _queueWithdrawal(strategy, shares, address(withdrawalQueue()));
  3. See the _queueWithdrawal function, here withdrawer is set to withdrawalQueue contract in QueuedWithdrawalParams.
  4. Now the function _queueWithdrawal calls the delegationManager’s queueWithdrawals function.
  5. See function queueWithdrawals(delegationManager contract),where a statement is require(queuedWithdrawalParams[i].withdrawer == msg.sender, "DelegationManager.queueWithdrawal: withdrawer must be staker");
    Here withdrawer must be msg.sender
  6. In RioLRTOperatorDelegator contract ,queuedWithdrawalParams[i].withdrawer is set to withdrawalQueue contract but here msg.sender of the function queueWithdrawals(delegationManager contract) is RioLRTOperatorDelegator contract. This will cause a revert.

Impact

Usersettlement will fail.

Code Snippet

https://github.com/sherlock-audit/2024-02-rio-network-core-protocol/blob/main/rio-sherlock-audit/contracts/restaking/RioLRTOperatorDelegator.sol#L217

https://github.com/Layr-Labs/eigenlayer-contracts/blob/dev/src/contracts/core/DelegationManager.sol#L275

Tool used

Manual Review

Recommendation

Make sure withdrawer and msg.sender is same when calling the function queueWithdrawals(delegationManager contract)

@solimander
Copy link

Invalid - Though we will be updating to support this change, it was made after the audited code was frozen. The target version is https://github.com/Layr-Labs/eigenlayer-contracts/tree/v0.2.1-goerli-m2

@sherlock-admin2 sherlock-admin2 added the Sponsor Disputed The sponsor disputed this issue's validity label Mar 7, 2024
@github-actions github-actions bot added Medium A valid Medium severity issue Has Duplicates A valid issue with 1+ other issues describing the same vulnerability labels Mar 16, 2024
@nevillehuang
Copy link
Collaborator

@solimander What was the exact time this change was introduced and do you have a link? I will have to consider only time after 20 February when the contest started.

@nevillehuang
Copy link
Collaborator

@solimander Could you point me to the right resource from the above comment?

@solimander
Copy link

@nevillehuang It was merged into the m2-mainnet branch in this PR: Layr-Labs/eigenlayer-contracts#409

Target tag was noted here: https://discord.com/channels/812037309376495636/1209514827442167839/1209965316323672084

@nevillehuang nevillehuang removed the Medium A valid Medium severity issue label Mar 23, 2024
@sherlock-admin2 sherlock-admin2 changed the title Plain Vinyl Cobra - Calling function queueWithdrawalForUserSettlement will revert. almurhasan - Calling function queueWithdrawalForUserSettlement will revert. Mar 26, 2024
@sherlock-admin2 sherlock-admin2 added Non-Reward This issue will not receive a payout and removed Has Duplicates A valid issue with 1+ other issues describing the same vulnerability labels Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

4 participants