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

Auctions will always be won by MEV bots and validators, leading to auctions ending at a low price #1122

Closed
c4-submissions opened this issue Nov 11, 2023 · 9 comments
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue grade-c QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue sufficient quality report This report is of sufficient quality unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-submissions
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L57-L61

Vulnerability details

Impact

Just like in https://code4rena.com/reports/2023-06-stader#m-13-no-bidder-has-incentive-to-bid-in-the-auction-except-doing-last-minute-mev-due-to-fixed-endblock auctions will be maliciously exploited by users bidding at the last block in order to win an auction with the lowest price possible.
As all auctions have a fixed end date, a bidder can perform an MEV attack and bid right before an auction ends with a bid only 1 wei higher than the previous highest bid.
This would not only prevent the previous highest bidder from outbidding the attacker and winning the auction, but could lead to severe losses for the protocol. As last-minute MEV is highly incentivized and a well-known vulnerability in auctions with fixed end times, it is possible that no user bids throughout the auction, but only races to bid in the final block of the auction, with the lowest price possible, which could be as low as 1 wei.

Proof of Concept

Here is a possible scenario:
As users know that MEV attacks are incentivized, all bidders aiming to bid at an auction, wait until the last block to make their bids. They all bid 1 wei, as no previous bids have been made, and the bidder, whose transaction is executed first wins the auction at practically no cost.

Tools Used

Manual review

Recommended Mitigation Steps

Increase an auction's end time after every bid and introduce a minimum bid price.

Assessed type

MEV

@c4-submissions c4-submissions 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 Nov 11, 2023
c4-submissions added a commit that referenced this issue Nov 11, 2023
@141345
Copy link

141345 commented Nov 16, 2023

any bid before endtime will break this vector.
Need more detailed discussion about how MEV can cause loss to auction.

@c4-pre-sort
Copy link

141345 marked the issue as sufficient quality report

@c4-pre-sort c4-pre-sort added the sufficient quality report This report is of sufficient quality label Nov 16, 2023
@c4-sponsor
Copy link

a2rocket (sponsor) disputed

@c4-sponsor c4-sponsor added the sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue label Nov 23, 2023
@a2rocket
Copy link

these are hypotheses, someone could bid at first a really high amount and then attackers may not wish to go so high also not everyone waits until last block.

@alex-ppg
Copy link

alex-ppg commented Dec 6, 2023

Duplicate of #736, discussion will be maintained there.

@c4-judge
Copy link

c4-judge commented Dec 6, 2023

alex-ppg changed the severity to QA (Quality Assurance)

@c4-judge c4-judge added downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Dec 6, 2023
@c4-judge c4-judge closed this as completed Dec 9, 2023
@c4-judge c4-judge added grade-c unsatisfactory does not satisfy C4 submission criteria; not eligible for awards labels Dec 9, 2023
@c4-judge
Copy link

c4-judge commented Dec 9, 2023

alex-ppg marked the issue as grade-c

@trachevgeorgi
Copy link

Disagree with QA. This is a well-known issue in auction contracts and as we can see here it was acknowledged as a valid Medium issue on a recent code4rena contest:
code-423n4/2023-06-stader-findings#70.
Also, here is a possible scenario, where a user can unfairly win an auction:
1/ User A wants to bid on an auction, they have evaluated the NFT at not more than 10ETH, so this will be their bidding limit
2/ Therefore, they bid 5ETH at first
3/ No other user outbids them except at the last possible block, where User B bids 5ETH + 1 wei
4/ In a normal auction User A would be able to outbid them but as it is the last block they lose the auction unfairly, even though they were willing to spend 5 more ETH
5/ This brings losses to both User A and the protocol, as User A lost the auction unfairly and the protocol could have sold the NFT for 5 more ETH
Resolving the issue would require increasing the end time of the auction after every bid. This would improve user experience and bring in more profits for the protocol.

@alex-ppg
Copy link

alex-ppg commented Dec 9, 2023

Hey @trachevgeorgi, thanks for contributing to the PJQA process! I am familiar with the relevant ruling and have elaborated on the primary issue this submission is a duplicate of. Please let me know if there is any further clarification you require.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue grade-c QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue sufficient quality report This report is of sufficient quality unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

8 participants