Submitted by ladboy233, also found by rvierdiiev and said
SwapType.CloseExactOut balance check too strict can be DOSed.
In CoreCallback function, we have the logic below:
Note the logic below:
This check is too strict:
Malicious user can DOS the swap by simply perform a tiny swap by frontruning the swap to change the token ratio in the LP pool.
For example, the swapInfo.amtOut is 1000 USDC, and swapInfo.tokenOut is USDC.
It is difficult to get exactly 1000 USDC, so any swap that executes before the swap can make the received USDC amount to 1000.1 USDC or 999. USDC, then swap transaction reverts.
Do not use ==, use >=
hansfriese (Judge) decreased severity to Medium and commented:
fez-init (INIT) confirmed
