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

forced to swap loan tokens with no slippage protection

Vulnerability Details

require(_profits != WETH, "not allowed");
uint256 amount = IERC20(_profits).balanceOf(address(this));
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,
tokenOut: WETH,
fee: 3000,
recipient: address(this),
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: 0, // @audit
sqrtPriceLimitX96: 0
});

As shown, all loan tokens are swapped and always use 0 for min out meaning that deposits will be sandwiched and stolen.

Impact

All loan tokens can be sandwiched and stolen

Tools Used

Manual Review

Recommendations

specify slippage parameters for loan tokens

Support

FAQs

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

Give us feedback!