-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin refundable fees can be bypassed and all rewards can be sent to deposit queue #149
Comments
Expected Behaviour. As the protocol does not guarantee that gas fee are refunded but just a best effort to cover for proof submission cost. |
CloudEllie marked the issue as primary issue |
Judging from the code and documentation, it seems to me that the protocol expected to get refunded that amount, otherwise the code could just be removed. Medium severity because the loss is not to general users but to the admin account, and the amounts are small. |
alcueca changed the severity to 2 (Med Risk) |
alcueca marked the issue as satisfactory |
alcueca marked issue #148 as primary and marked this issue as a duplicate of 148 |
Hey @alcueca I believe this issue to be a QA rather than M for the following reasons:
So the fact that there are zero admin/user funds lost, attacker gains nothing from this and the functionality of the protocol isn't affected by this and the sponsor choosing to not fix this, makes me strongly believe this (and its duplicates) is a QA. @jatinj615 Would appreciate your input on my thoughts. |
@s1n1st3r0 , as I specified in the comment this is just a best effort by the protocol to refund some gas to trusted admins performing proof verifications. |
alcueca changed the severity to QA (Quality Assurance) |
alcueca marked the issue as grade-b |
Lines of code
https://github.com/code-423n4/2024-04-renzo/blob/519e518f2d8dec9acf6482b84a181e403070d22d/contracts/Delegation/OperatorDelegator.sol#L481-L525
Vulnerability details
Impact
Validators execution rewards will be sent to operator delegator contract from the withdrawal router. When the ether is received in
OperatorDelegator
as a result of this, thetx.origin
will be refunded as gas considering thetx.origin
is the admin. However, initiating a claim in delayed withdrawal router in EigenLayer is permissionless which anyone can claim behalf of the operator delegator. Since the address that will claim is not the restaking admin of the operator delegator, all the funds will be sent to the deposit queue and admin will not be able to take the fees from it.Proof of Concept
Admin records fees to be taken when:
the recording of the fee is as follows:
and this is the _recordGas implementation:
since the admin can only call these functions,
msg.sender
will have the role restake admin role guaranteed.Now, when and how the validator rewards claimed from EigenPod?
Beacon chain effective balance is capped to 32 ether anything that is above this can be partially withdrawn to the EigenPod owner with a delayed router. The funds will be sent to
DelayedRouter
and once the delay passes anyone can claim behalf of the account.When the amounts are claimed from EigenLayer delayed router, ether will sent to the pod owner which is the
OperatorDelegator
contract as follows:https://github.com/Layr-Labs/eigenlayer-contracts/blob/98685285e5e504fa6180c010d2835cd506c4ecc6/src/contracts/pods/DelayedWithdrawalRouter.sol#L216-L218
Since this is a plain ether transfer, the
receive()
function will be triggered in operator delegator contract:since the
tx.origin
will be the random address that calls the claim in delayed router behalf of the operator delegator contract theadminGasSpentInWei[tx.origin]
will be 0. Hence, there won't be any fees taken and all the claimed amount will be sent to deposit queue.In result, admin can never receive its gas fees since users are incentivized to call claim themselves to bypass the admin fee and receive more rewards which increases ezETH exchange rate further.
Tools Used
Recommended Mitigation Steps
Regardless of the tx.origin, take the fees. Otherwise, users are well encouraged and incentivized to call claim themselves.
Assessed type
Other
The text was updated successfully, but these errors were encountered: