code-423n4 / 2024-05-bakerfi-findings

4 stars 4 forks source link

Missing slippage in the call to `exactInputSingle()` inside `UseSwapper::_swap()` #17

Closed c4-bot-9 closed 5 months ago

c4-bot-9 commented 5 months ago

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 inside ExactInputSingleParams.

Assessed type

Other

c4-judge commented 5 months ago

0xleastwood marked the issue as duplicate of #32

c4-judge commented 5 months ago

0xleastwood changed the severity to 3 (High Risk)

c4-judge commented 5 months ago

0xleastwood marked the issue as satisfactory