The exactInputSingle() inside _swap() function uses a amountOutMinimum param with a value of zero. Thus it offers no slippage protection to the caller and can result in sandwich attacks or even under the normal flow of events a bad price for which the caller was not ready.
Tools Used
Manual review
Recommended Mitigation Steps
Set it to a user provided param by specifying amountOutMinimum: params.amountOutMinimum inside ExactInputSingleParams.
Lines of code
https://github.com/code-423n4/2024-05-bakerfi/blob/main/contracts/core/hooks/UseSwapper.sol#L72
Vulnerability details
Description
The exactInputSingle() inside _swap() function uses a
amountOutMinimum
param with a value of zero. Thus it offers no slippage protection to the caller and can result in sandwich attacks or even under the normal flow of events a bad price for which the caller was not ready.Tools Used
Manual review
Recommended Mitigation Steps
Set it to a user provided param by specifying
amountOutMinimum: params.amountOutMinimum
insideExactInputSingleParams
.Assessed type
Other