block.timestamp to artificially delay the auction end by a few seconds, harming the playing field by allowing themselves or other bidders to place bids when the auction should have ended.Normal behaviour: By placing a bid on an NFT during a live auction that is due to end in the next 15 minutes, the auction end is extended by another 15 minutes.
Problematic behaviour: A miner can manipulate the regular bidding logic in BidFeastsNFTMarketPlace::placeBid function and give themselves more time to bid on a listed NFT by setting the block.timestamp up to 15 seconds in the future compared to real time.
Root cause:
Likelihood: Low (small time window and minimal financial incentive for the miner)
This vulnerability occurs when
A miner manipulates block.timestamp and sets it up to 15 seconds to the future.
A miner wants to allow themselves or other bidders more time to place bids.
Impact: Low (small time window of up to 15 seconds)
The block timestamp manipulation impacts the contract by
changing the intended bidding logic as set out in the BidBeastsNFTMarketPlace::placeBid function.
creating an imbalance in the playing field, giving more time to some users to place bids and potentially win an NFT.
As a PoC, add the following test in the Foundry test suite and run with forge test --mt test_BlockTimestampManipulation_AllowsMinerToDelayAuctionEnd:
A) Accept the vulnerability and clearly document it in the contract.
B) Use block.number instead of block.timestamp since it is harder to manipulate and adjust the contract logic accordingly.
Example:
where AVERAGE_BLOCK_TIME_IN_SECONDS is a constant variable with the average Ethereum block time.
C) Use an oracle (eg., Chainlink) to completely get rid of the time manipulation vulnerability.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.