Skip to content

Solution is susceptible to MEV, harming users. #30

@code423n4

Description

@code423n4

Handle

evertkors

Vulnerability details

Impact

Miners can hold back transactions and creating beneficial situation for themselves (based on state of solution).

There is not deadline on executing executeOutstandingNextPriceSettlementsUser(), which means the transaction can be delayed until MEV can be extracted.

Proof of Concept

Don't know the exact math of the solution but a miner can hoard one or more transactions calling executeOutstandingNextPriceSettlementsUser() (or similar function). And potentially include a transaction from the MEV marketplace that makes a lot of profit on behalves of the users trying to execute this transaction.

Recommended Mitigation Steps

I recommend to include a deadline in the executeOutstandingNextPriceSettlementsUser transaction. (just like Uniswap does)

e.g.

executeOutstandingNextPriceSettlementsUser(address user, uint32 marketIndex, uint256 deadline) external override {
    require(deadline <= block.number);
    ....
}

This mitigates the issue by limiting the amount of transactions the miner is able to hoard.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions