This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
zzykxx - The protocol can't receive rewards because of low gas limits on ETH transfers #185
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
zzykxx
high
The protocol can't receive rewards because of low gas limits on ETH transfers
Summary
The hardcoded gas limit of the Asset::transferETH() function, used to transfer ETH in the protocol, is too low and will result unwanted reverts.
Vulnerability Detail
ETH transfers in the protocol are always done via Asset::transferETH(), which performs a low-level call with an hardcoded gas limit of
10_000
:The hardcoded
10_000
gas limit is not high enough for the protocol to be able receive and distribute rewards. Rewards are currently only available for native ETH, an are received by Rio via:32ETH
on full withdrawalsThe flow to receive rewards requires two steps:
RioLRTOperatorDelegator
instanceThe call to DelayedWithdrawalRouter::claimDelayedWithdrawals() triggers the following flow:
receive()
function is triggered.receive()
function of RioLRTOperatorDelegator transfers ETH via Asset::transferETH() to the RioLRTRewardDistributor, where anotherreceive()
function is triggered.receive()
function of RioLRTRewardDistributor transfers ETH via Asset::transferETH() to thetreasury
, theoperatorRewardPool
and theRioLRTDepositPool
.The gas is limited at
10_000
in step2
and is not enough to perform step3
, making it impossible for the protocol to receive rewards and leaving funds stuck.POC
Add the following imports to
RioLRTOperatorDelegator.t.sol
:then copy-paste:
Impact
The protocol is unable to receive rewards and the funds will be stucked.
Code Snippet
Tool used
Manual Review
Recommendation
Remove the hardcoded
10_000
gas limit in Asset::transferETH(), at least on ETH transfers where the destination is a protocol controlled contract.The text was updated successfully, but these errors were encountered: