The Smart Vault's swapping mechanism via Uniswap V3 lacks slippage protection, exposing it to potential sandwich attacks, risking substantial token losses
The vulnerability exists within the swap() function, where the Smart Vault swaps collateral without accounting for slippage, making it susceptible to sandwich attacks
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/SmartVaultV3.sol#L214
The calculateMinimumAmountOut()
private function sets the minimum output amount
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/SmartVaultV3.sol#L206
At line 210 minoutputAmount has been set to zero of collateralValueMinusSwapValue >= requiredCollateralValue
which only makesures that smart vault is overcollateralised even after using amount
input collateral tokens.
The absence of slippage consideration exposes the vault to potential token losses through sandwich attacks during swaps.
Manual
Introduce a user-input parameter allowing specification of a minimum amount out for swaps
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.