code-423n4 / 2023-10-nextgen-findings

5 stars 3 forks source link

AuctionDemo::claimAuction() - L105: Logic bug in the conditional statement where the timestamp check should be `>` instead of `>=`. #2024

Closed c4-submissions closed 11 months ago

c4-submissions commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/a6f2397b68ef2865374c1bf7629349f25e71a44d/smart-contracts/AuctionDemo.sol#L105

Vulnerability details

Impact

Proof of Concept

If it's still unclear, let me clarify from a different perspective: Auction duration is from 0 to 10, lets say. We can only select auction winner AFTER the auction (duration). This means > 10, NOT >= 10. If we wanted to make 10 valid for auction winner selection, then we would need to make auction duration from 0 to 9, where the auction ends at 9. Now we can have >= 10 which is logically correct.

Tools Used

VSC. Manual.

Recommended Mitigation Steps

- require(block.timestamp >= minter.getAuctionEndTime(_tokenid) && auctionClaim[_tokenid] == false && minter.getAuctionStatus(_tokenid) == true);
+ require(block.timestamp > minter.getAuctionEndTime(_tokenid) && auctionClaim[_tokenid] == false && minter.getAuctionStatus(_tokenid) == true);

Assessed type

Other

c4-pre-sort commented 1 year ago

141345 marked the issue as duplicate of #1391

c4-judge commented 11 months ago

alex-ppg marked the issue as not a duplicate

c4-judge commented 11 months ago

alex-ppg marked the issue as duplicate of #175

c4-judge commented 11 months ago

alex-ppg marked the issue as unsatisfactory: Insufficient quality