[M-01] Inexistent slippage protection for stake/deposit #849
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-150
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/SfrxEth.sol#L94
https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/derivatives/WstEth.sol#L73
Vulnerability details
Impact
Stake/Deposit actions do not specify any minimum accepted values. This renders users and the protocol prone to arbitrage attacks, causing them to receive less than expected value.
Proof of Concept
Using
deposit()
in theSfrxEth.sol
contract:If the
frxETHMinterContract.submitAndDeposit
returns a very low amount (due to arbitrage or error on Frax’s contract), the protocol will assume very little was deposited and mint less safETH to the user who staked.Tools Used
Manual review
Recommended Mitigation Steps
It is advised to add a param to
stake()
to relay expected minimum receive values and revert if the minimum is not received. For example:The text was updated successfully, but these errors were encountered: