This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
RioLRTCoordinator.requestWithdrawal
, availableShares
doesn't consider previous queued withdrawals and users can request withrawal more than available shares.
#242
kennedy1030
high
In
RioLRTCoordinator.requestWithdrawal
,availableShares
doesn't consider previous queued withdrawals and users can request withrawal more than available shares.kennedy1030
high
Summary
If there is not sufficient shares for users withdrawal request, it should be reverted because of the insufficient shares for withdrawal
availableShares
contains all assets in the deposit pool and eigen layer, it also contains the queued withdrawals but only reduce the current epoch shares owed, hence the user can request withdrawal without limit.Vulnerability Detail
https://github.com/sherlock-audit/2024-02-rio-network-core-protocol/blob/4f01e065c1ed346875cf5b05d2b43e0bcdb4c849/rio-sherlock-audit/contracts/restaking/RioLRTWithdrawalQueue.sol#L112
At [L112] from
availableShares
previous queued withdrawals should be removed but the only current epoch shares owed is removed. Hence the check can bypass and the users request withdrawal without limit.Impact
Users can request withdrawal and queue it with no check or limit and this is against the check at [L112] and this may break the protocol.
Code Snippet
https://github.com/sherlock-audit/2024-02-rio-network-core-protocol/blob/4f01e065c1ed346875cf5b05d2b43e0bcdb4c849/rio-sherlock-audit/contracts/restaking/RioLRTWithdrawalQueue.sol#L112
Tool used
Manual Review
Recommendation
Previous queued withdrawal should be removed also at [L112]
For this, a state variable
totalSharesOwed
and a view functiongetTotalSharesOwed()
has to be added intoRioLRTWithdrawalQueue.sol
.https://github.com/sherlock-audit/2024-02-rio-network-core-protocol/blob/4f01e065c1ed346875cf5b05d2b43e0bcdb4c849/rio-sherlock-audit/contracts/restaking/RioLRTWithdrawalQueue.sol#L112
Duplicate of #361
The text was updated successfully, but these errors were encountered: