Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Reliance on `block.timestamp` in `settleAuction` Enables Premature Auction Settlement

Description

The contract uses the global variable block.timestamp to determine when an auction has ended inside settleAuction:

function settleAuction(uint256 tokenId) external isListed(tokenId) {
Listing storage listing = listings[tokenId];
require(listing.auctionEnd > 0, "Auction has not started (no bids)");
require(block.timestamp >= listing.auctionEnd, "Auction has not ended"); // VULNERABLE LINE
require(bids[tokenId].amount >= listing.minPrice, "Highest bid did not meet min price");
_executeSale(tokenId);
}

Since miners can influence block.timestamp within a small range (commonly up to ~900 seconds, depending on network rules), this creates a manipulation vector:

  • A miner or colluding entity could advance the timestamp to meet the listing.auctionEnd requirement, allowing premature auction settlement.

  • While the impact window is small, it undermines fairness for bidders expecting the auction to run until the exact advertised end time.

Risk and Impact

  • Risk: Low – requires miner collusion or block production control.

  • Impact: High – an attacker can end auctions slightly earlier than intended, depriving bidders of their fair chance to submit last-minute bids.

Severity: Medium – exploitation requires specific conditions (miner influence) but creates significant fairness issues.

PoC

  1. Auction is scheduled to end at T = 1000.

  2. At T = 995, a malicious miner includes a block with block.timestamp = 1000.

  3. The auction contract interprets the auction as finished.

  4. The miner (or colluding attacker) immediately calls settleAuction(tokenId) and finalizes the sale.

  5. Other bidders expecting the auction to run for 5 more seconds lose their opportunity to participate.

Recommended Mitigation

Integrate a decentralized time oracle or automation service (e.g., Chainlink Keepers) to provide reliable and tamper-resistant auction finality.

Updates

Lead Judging Commences

cryptoghost Lead Judge 2 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Appeal created

0xh4145 Submitter
2 months ago
cryptoghost Lead Judge
2 months ago
cryptoghost Lead Judge 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BidBeasts Marketplace: Improper Documentation

Documentation for BidBeasts Marketplace is incomplete or inaccurate, potentially leading to misconfigurations or security misunderstandings.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!