RadCet - stEth::transferFrom
will transfer 1-2 less way result in revert in deposit function
#141
Labels
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
RadCet
High
stEth::transferFrom
will transfer 1-2 less way result in revert in deposit functionSummary
Many cases stEth::transferFrom will transfer 1-2 less way, which would result in revert in consequent functions, because of not enough balance
Vulnerability Detail
In
DepositWrapper:deposit
, user call this function to deposit weth, steth,.. However when user try to deposit stETH, contract usingIERC20(steth).safeTransferFrom(sender, wrapper, amount);
to send seETH from user to contract. stETH is using shares for tracking balances and it is a known issue that due to rounding error, transferred shares may be 1-2 wei less than _amount passed. So when call_DepositWrapper:stethToWsteth
will be revert due to not enough balance.Impact
Deposit function for stETH is DOS
Possibility: The probability of issue appearing is high and you can check in the following discussion. It has also been classified as a High severity on past contests: lidofinance/lido-dao#442
Code Snippet
DepositWrapper:deposit
Tool used
Manual Review
Recommendation
Use lido recommendation to utilize transferShares function, so the _amount is realistic, or compares the balance before and after the transfer.
Duplicate of #299
The text was updated successfully, but these errors were encountered: