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

User can win the auction or ddos it, thanks to the cancel bid function #1379

Closed
c4-submissions opened this issue Nov 12, 2023 · 8 comments
Closed
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-1323 partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) upgraded by judge Original issue severity upgraded from QA/Gas by judge

Comments

@c4-submissions
Copy link
Contributor

Lines of code

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

Vulnerability details

Impact

The user can win the auction by spending a small amount to do so. Or it may block the auction.
This is because you can cancel your bet. Even if the user has only one.

Proof of Concept

Case: The user wins the auction by spending a small amount on it.

  1. As soon as the auction begins, the user places a bid for a small amount. And in the same transaction, the next call is to bet on a very large amount, which is unlikely to be outbid by anyone.
  2. Before the end of the auction, the user calls the cancel bid function and cancels his bid for a large amount
  3. The user becomes the winner of the auction since no one else was able to participate in it. And most importantly, he receives NFT for the amount of the first bet - for a small amount.

Case: The user blocks the auction

  1. When the auction begins, the user places a bid for a very large amount, which is unlikely to be outbid by anyone
  2. Waits for the end of the auction, and just before the end, sends a request to cancel his bid. The auction ends and as a result, no one bought NFT due to user actions

Tools Used

Manual review

Recommended Mitigation Steps

Allow to users cancel their bids, if they have at least 2 active bids.

Assessed type

DoS

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

141345 marked the issue as duplicate of #962

@c4-judge
Copy link

c4-judge commented Dec 2, 2023

alex-ppg marked the issue as not a duplicate

@c4-judge c4-judge reopened this Dec 2, 2023
@c4-judge
Copy link

c4-judge commented Dec 2, 2023

alex-ppg marked the issue as duplicate of #1784

@c4-judge
Copy link

c4-judge commented Dec 7, 2023

alex-ppg marked the issue as duplicate of #1323

@c4-judge
Copy link

c4-judge commented Dec 8, 2023

alex-ppg marked the issue as partial-25

@c4-judge c4-judge added the partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) label Dec 8, 2023
@c4-judge
Copy link

c4-judge commented Dec 8, 2023

alex-ppg marked the issue as satisfactory

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) and removed partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) satisfactory satisfies C4 submission criteria; eligible for awards labels Dec 8, 2023
@c4-judge
Copy link

c4-judge commented Dec 8, 2023

alex-ppg marked the issue as partial-25

@c4-judge c4-judge added 3 (High Risk) Assets can be stolen/lost/compromised directly upgraded by judge Original issue severity upgraded from QA/Gas by judge and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Dec 9, 2023
@c4-judge
Copy link

c4-judge commented Dec 9, 2023

alex-ppg changed the severity to 3 (High Risk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-1323 partial-25 Incomplete articulation of vulnerability; eligible for partial credit only (25%) upgraded by judge Original issue severity upgraded from QA/Gas by judge
Projects
None yet
Development

No branches or pull requests

3 participants