Missing deadline check in UlyssesRouter #200
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-504
edited-by-warden
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-amm/UlyssesRouter.sol#L49
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-amm/UlyssesRouter.sol#L59
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-amm/UlyssesRouter.sol#L73
Vulnerability details
Impact
addLiquidity()
,removeLiquidity()
,swap()
don't have deadline parameter. It means that transaction can be pending in mempool so long, such thatminOutput
is too low comparing to current price at execution, and therefore high slippage action is performed.Proof of Concept
Suppose current scenario:
minOutput = 1000 * 1 * (100% - 1%) = 990
minOutput = 1000 * 2 * (100% - 1%) = 1980
, but user specified 990 and can perform bad trade because of slippageTools Used
Manual Review
Recommended Mitigation Steps
Add deadline argument and check it, like UniswapV2Router does:
Assessed type
MEV
The text was updated successfully, but these errors were encountered: