-
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
Possible to cancel bids after the auction is over which allows a malicious user to win the Auction using the lowest bid #1561
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
c4-submissions
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
labels
Nov 13, 2023
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 |
c4-judge
added
duplicate-1323
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
and removed
duplicate-1513
labels
Dec 7, 2023
alex-ppg marked the issue as partial-50 |
c4-judge
added
satisfactory
satisfies C4 submission criteria; eligible for awards
and removed
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
labels
Dec 8, 2023
alex-ppg marked the issue as satisfactory |
alex-ppg marked the issue as partial-50 |
c4-judge
added
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
and removed
satisfactory
satisfies C4 submission criteria; eligible for awards
labels
Dec 8, 2023
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
ttps://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L124-L130
Vulnerability details
Possible to cancel bids after the auction is over which allows a malicious user to win the Auction using the lowest bid
To participate in the auction we call https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L57-L61
Say we have a user Alice ,Alice makes a bid quoting a very high amount,this would prevent majority from participating in the bid since Alice set the bid amount too high.
Due to how the require statement is used
block.timestamp <= minter.getAuctionEndTime(_tokenid)
it's possible to participate in the Auction whenblocktimestanp is equal the endtime
The main issue arises in that, it's possible for a user to cancel their bid when the Auction ends
The
CancelBid()
function is implemented as follows https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L124-L130So Alice, notices that we can cancel a bid when
block.timestamp <= minter.getAuctionEndTime(_tokenid)
which means , it's possible to cancel whenblock.timestamp
is equal to the end time.So Alice waits until the end and immediately calls the
cancelBid()
function while calling theparticipateToAuction()
function also but this time with a lower bid.Another scenario would be if we have two malicious accounts ,the first places a lower bid say 1 wei which goes through since its the first bid,the other malicious account places a very big bid preventing other bidders from bidding, When the Auction is over ,the one with the higher bid cancels their bid leaving the first one who placed the smallest bid as the winner
Recommendation
We can solve it in two ways, either do not allow bids to be cancelled unless
block.timestamp > minter.getAuctionEndTime(_tokenid)
or limit participation to only allow bids whenblock.timestamp <= minter.getAuctionEndTime(_tokenid)
Tool Used
Manual review
Assessed type
Timing
The text was updated successfully, but these errors were encountered: