No deadline for swaps allows transactions to be executed later, unfavourably or maliciously.
Proof of Concept
When tokens are to be swapped rather than minted, slippage is controlled in uniswapV3SwapCallback() by _minimumAmountReceived which is calculated from the _quote and _slippage provided in _metadata. If the transaction remains pending for a long time these slippage parameters might become outdated, resulting in a bad trade for the user. This could then also be exploited with a sandwich attack by an MEV bot.
Recommended Mitigation Steps
Pass a deadline in _metadata which if passed reverts in _swap().
Lines of code
https://github.com/code-423n4/2023-05-juicebox/blob/9d0458282511ff269b3b35b5b082b56d5cc08663/juice-buyback/contracts/JBXBuybackDelegate.sol#L258-L326
Vulnerability details
Impact
No deadline for swaps allows transactions to be executed later, unfavourably or maliciously.
Proof of Concept
When tokens are to be swapped rather than minted, slippage is controlled in
uniswapV3SwapCallback()
by_minimumAmountReceived
which is calculated from the_quote
and_slippage
provided in_metadata
. If the transaction remains pending for a long time these slippage parameters might become outdated, resulting in a bad trade for the user. This could then also be exploited with a sandwich attack by an MEV bot.Recommended Mitigation Steps
Pass a deadline in
_metadata
which if passed reverts in_swap()
.Assessed type
Invalid Validation