Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UlyssesRouter has no expiration time protection #719

Closed
code423n4 opened this issue Jul 5, 2023 · 3 comments
Closed

UlyssesRouter has no expiration time protection #719

code423n4 opened this issue Jul 5, 2023 · 3 comments
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 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

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

UlyssesRouter has no expiration time protection, if the token price changes before tx execution, it will affect user earnings.

Proof of Concept

  1. User send a tx for swaping tokenA -> tokenB, who sets the slippage based on the current market price of the token
  2. The tx remained in mempool for a long time due to network congestion
  3. The tokenA market price rises before tx execution and can be exchanged for more tokenB
  4. But the searcher sees this tx and takes it out of mempool to perform a sandwich arbitrage, bringing the gain down to the slippage and the user's earnings are lost

Tools Used

Manual review

Recommended Mitigation Steps

Add expiration time protection for UlyssesRouter

Assessed type

MEV

@code423n4 code423n4 added 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 labels Jul 5, 2023
code423n4 added a commit that referenced this issue Jul 5, 2023
@c4-judge
Copy link
Contributor

c4-judge commented Jul 9, 2023

trust1995 marked the issue as unsatisfactory:
Invalid

@c4-judge c4-judge closed this as completed Jul 9, 2023
@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Jul 9, 2023
@c4-judge
Copy link
Contributor

trust1995 marked the issue as duplicate of #171

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards and removed unsatisfactory does not satisfy C4 submission criteria; not eligible for awards labels Jul 25, 2023
@c4-judge
Copy link
Contributor

trust1995 marked the issue as satisfactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants