when block.timestamp == auctionEndTime, attackers can end auction, bid large amount and then claim, draining the auction tokens from bidders
Context:
FjordAuction.sol#L182
In the FjordAuction.sol, the bid()
and unbid()
can execute as long as the current time is not past the auction end time:
this means when the block.timestamp == auctionEndTime it will still be executed. The issue here is that the auctionEnd()
function can also be executed when block.timestamp == auctionEndTime:
As seen above it only checks if it's less than but doesn't handle when it's == auctionEndTime, therefore when block.timestamp == auctionEndTime this allows an attacker to end an auction which then set the multiplier,:
call the bid function to bid in a large amount, and then claim all the tokens using the claimTokens()
function all in a single transaction. draining the auction tokens from bidders seen attacker bid wasn't included in the totalBid used in the multiplier calculations.
Attackers can drain the auction tokens from bidders
Manaul Review
Ensure both bid/unbid and auctionEnd can't be called at the same time. Set one of these to handle when block.timestamp == auctionEndTime. E.g
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.
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.