The FjordAuction contract is susceptible to timestamp manipulation due to its reliance on block.timestamp for determining the auction end time. This vulnerability allows miners to slightly adjust the auction duration, potentially providing an unfair advantage to certain participants.
auctionEndTime = block.timestamp.add(_biddingTime);
1.Timestamp Dependency:
The contract's constructor sets auctionEndTime using block.timestamp + _biddingTime.
This makes the auction duration dependent on the block's timestamp at the time of deployment.
2.Miner Manipulation:
Miners can adjust block.timestamp (up to 15 seconds forward or backward).
By mining the block in which the auction is deployed, a miner can manipulate the timestamp to extend or shorten the auction duration.
3.Proof of Concept:
Deploy the FjordAuction contract with a specified biddingTime.
Use a testing framework to simulate a miner setting block.timestamp slightly ahead.
Verify that auctionEndTime is extended beyond the intended duration.
Miners who participate in the auction can manipulate the end time to gain more time for placing bids or to cut off other participants early.
The integrity of the auction process is compromised, as participants cannot rely on a fixed auction duration.
Participants may have their bidding strategies disrupted due to unexpected changes in auction timing.
Manual review
Foundry
Instead of relying on block.timestamp, consider using block.number to determine the auction end. Calculate the end block based on an estimated average block time.
Introduce a buffer period to mitigate minor timestamp manipulations, ensuring that small adjustments by miners do not significantly impact the auction outcome.
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.