Submitted by Infect3d, also found by 0xDemon, Bryan_Conquer, Evo, hyuunn,SpicyMeatball, KupiaSec, NexusAudits, OpaBatyo, and pumba
https://github.com/code-423n4/2024-12-lambowin/blob/main/src/LamboVEthRouter.sol#L102-L102
https://github.com/code-423n4/2024-12-lambowin/blob/main/src/LamboVEthRouter.sol#L148-L148
sellQuote and buyQuote are missing deadline check in LamboVEthRouter.
Because of that, transactions can still be stuck in the mempool and be executed a long time after the transaction is initially called. During this time, the price in the Uniswap pool can change. In this case, the slippage parameters can become outdated and the swap will become vulnerable to sandwich attacks.
The protocol has made the choice to develop its own router to swap tokens for users, which imply calling the low level UniswapV2Pair::swap function:
As the comment indicates, this function require important safety checks to be performed.
A good example of safe implementation of such call can be found in the UniswapV2Router02::swapExactTokensForTokens function:
As we can see, 2 safety parameters are present here: amountOutMin and deadline.
Now, if we look at SellQuote (buyQuote having the same issue):
We can see that no deadline parameter is present.
The transaction can still be stuck in the mempool and be executed a long time after the transaction is initially called. During this time, the price in the Uniswap pool can change. In this case, the slippage parameters can become outdated and the swap will become vulnerable to sandwich attacks.
Add a deadline parameter.
Shaneson (Lambo.win) acknowledged
