DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: medium
Valid

Bid Function Allows Bidding at the Exact Auction End Time

Summary

See below

Vulnerability Details

In the FjordAuction contract, the bid function allows users to place bids as long as the current time is not strictly greater than the auction end time (auctionEndTime). The relevant code snippet is:

function bid(uint256 amount) external {
if (block.timestamp > auctionEndTime) {
revert AuctionAlreadyEnded();
}
// Bidding logic
}

The condition block.timestamp > auctionEndTime means that users can still place bids if the current timestamp is exactly equal to auctionEndTime. The purpose of the bid function is to accept bids only before the auction ends, but this implementation allows bids to be placed at the exact end time of the auction, which may not be the intended behavior.

Impact

This behavior could lead to unexpected last-second bids being accepted at the exact end time of the auction, potentially disrupting the auction process and fairness.

Tools Used

Manual

Recommendations

To ensure that no bids are accepted at or after the auction end time, modify the condition to:

if (block.timestamp >= auctionEndTime) {
revert AuctionAlreadyEnded();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Users can bid in the same block when the actionEnd could be called (`block.timestamp==actionEndTime`), depending on the order of txs in block they could lose funds

The protocol doesn't properly treat the `block.timestamp == auctionEndTime` case. Impact: High - There are at least two possible impacts here: 1. By chance, user bids could land in a block after the `auctionEnd()` is called, not including them in the multiplier calculation, leading to a situation where there are insufficient funds to pay everyone's claim; 2. By malice, where someone can use a script to call `auctionEnd()` + `bid(totalBids)` + `claimTokens()`, effectively depriving all good faith bidders from tokens. Likelihood: Low – The chances of getting a `block.timestamp == auctionEndTime` are pretty slim, but it’s definitely possible.

Support

FAQs

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