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

Attacker can game the auction, resulting in either winning the NFT at 1 wei or freezing the funds! #947

Closed
c4-submissions opened this issue Nov 10, 2023 · 5 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-1785 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/main/smart-contracts/AuctionDemo.sol#L116

Vulnerability details

Impact

Attacker can game the auction, resulting in either winning the NFT at 1 wei or freezing the funds!

Proof of Concept

  1. Auction for a tokenId(NFT) starts.
  2. Attacker front-runs everybody to participate in the auctions, by bidding a minimal amount of 1 wei
  3. If Nobody Participates in the auction, the Attacker just gets the NFT at 1 wei
  4. If somebody participates with a higher bid, the Attacker can just consume all the gas at the time of refund, reverting the transaction to claimAuction and freezing the funds of everybody!
  5. This results in a win-win situation for the attacker, where he either freezes funds or ends up getting the NFT for a very unreasonable price!

The attacker can do this for every tokenId that comes to the auction, resulting in getting NFT in all the auctions at a minimum price or freezing participants' funds!

Tools Used

Manual

Recommended Mitigation Steps

A fixed amount of gas should be passed to the receiver at the time of refund.

Assessed type

ETH-Transfer

@c4-submissions c4-submissions added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Nov 10, 2023
c4-submissions added a commit that referenced this issue Nov 10, 2023
@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #486

@c4-judge
Copy link

c4-judge commented Dec 1, 2023

alex-ppg marked the issue as not a duplicate

@c4-judge
Copy link

c4-judge commented Dec 1, 2023

alex-ppg marked the issue as duplicate of #2006

@c4-judge c4-judge added duplicate-1785 unsatisfactory does not satisfy C4 submission criteria; not eligible for awards and removed duplicate-2006 labels Dec 5, 2023
@c4-judge
Copy link

c4-judge commented Dec 5, 2023

alex-ppg marked the issue as unsatisfactory:
Out of scope

1 similar comment
@c4-judge
Copy link

c4-judge commented Dec 8, 2023

alex-ppg marked the issue as unsatisfactory:
Out of scope

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-1785 unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

3 participants