20,000 USDC
View results
Submission Details
Severity: high
Valid

Lack of slippage control

Summary

Missing slippage check in ExactInputSingleParams, which could result in loss of funds for user.

ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});

https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Fees.sol#L30C1-L40

Vulnerability Details

amountOutMinimum is used to specify the minimum amount of tokens the caller wants to be returned from a swap. Using amountOutMinimum = 0 tells the swap that the caller will accept a minimum amount of 0 output tokens from the swap, opening up the user to a huge loss of funds via MEV bot sandwich attacks.

Impact

Loss of funds.

Tools Used

Manual Review.

Recommendations

Use parameter amountOutMinimum correctly to avoid loss of funds.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!