-
Notifications
You must be signed in to change notification settings - Fork 3
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
Malicious user can claim NFT for 1 Wei in Auction Minting by blocking others #1245
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-1323
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Comments
141345 marked the issue as duplicate of #962 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #1784 |
alex-ppg marked the issue as duplicate of #1323 |
alex-ppg marked the issue as partial-50 |
alex-ppg marked the issue as satisfactory |
alex-ppg marked the issue as partial-50 |
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-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L276
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L57-L61
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L134-L143
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L104-L120
Vulnerability details
description
NextGen Protocol implements a phase where the creator can call
mintAndAuction()
for certain NFTs in collection for a fixed duration of time, during which users can bid the price they are willing to pay for the NFT, and the highest bidder at the end of the auction gets the NFT.Every bidder has to pay the ETH amount they are willing to bid, and it has to be higher than the previous bid. In the end, the winner gets the NTF, and the rest of the bids are returned to the respective bidders.
vulnerability
Alll the bids are stored in an array of struct
auctionInfoData[_tokenid]
, Each time a new bid is made, a struct containing the address of the bidder and their bid is pushed into the array.Any user can make multiple bids in auction and are also allowed to cancel their bids before the auctions ends.
exploit
A malicious user can simply back-run the
mintAndAuction()
and place two bids:Then this malicious user simply waits till the auction is about to end.
Meanwhile other interested buyers won't make a bid seeing the absurd bid by our malicious user, and even if they tried to make one with a fair value (say of half or one third of our malicious user's second bid), it will be rejected as it wont be higher than the previous bid.
When the auction is just about to end, the malicious user will call
cancelBid()
for their second bid, cancelling it and getting his high value bid amount back.As a result, there will be only one bid when the auction ends: that of 1 wei by attacker, allowing him to claim the NFT for just 1 wei.
Now, there is a possibility that the malicious user may get back-run or that the transaction does not go through before auction ends, but for precious NFT, he has a very good incentive to pay the Validators/Miners and brick the auction.
impact
proof of concept
tools used
manual review
recommended mitigation steps
cancelBid()
functionality altogether.Assessed type
MEV
The text was updated successfully, but these errors were encountered: