-
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
AuctionDemo.claimAuction
should not accept block.time == minter.getAuctionEndTime(_tokenid)
#1659
Labels
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
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-175
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
141345 marked the issue as duplicate of #1935 |
141345 marked the issue as duplicate of #962 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #1926 |
1 similar comment
alex-ppg marked the issue as duplicate of #1926 |
alex-ppg marked the issue as satisfactory |
alex-ppg changed the severity to 2 (Med Risk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-175
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L58
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L105
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L125
Vulnerability details
Impact
A bidder can call
AuctionDemo.participateToAuction
to make a bid. And the winner can callAuctionDemo.claimAuction
to claim the token and the other bidders will be refunded. However, if the two transactions take place in the same block. The bidder’s could be locked in the contract forever.Proof of Concept
A bidder can make a bid when
block.timestamp <= minter.getAuctionEndTime(_tokenid)
.https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L58
And the winner can claim the token when
block.timestamp >= minter.getAuctionEndTime(_tokenid)
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L105
We can notice that if
block.timestamp == minter.getAuctionEndTime(_tokenid)
. Both functions can be called.Suppose Alice has the highest bid.
claimAuction
participateToAuction
cancelBid
since the new block.time is greater thanminter.getAuctionEndTime(_tokenid)
.https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L125
Tools Used
Manual Review
Recommended Mitigation Steps
There are two possible methods to fix the issue
auctionClaim[_tokenid]
inparticipateToAuction
claimAuction
should not acceptblock.time == minter.getAuctionEndTime(_tokenid)
Assessed type
Timing
The text was updated successfully, but these errors were encountered: