When one auction ends, the multiplier will be calculated, and all bidders can share the auction tokens. But when block.timestamp == auctionEndTime, bidders still can bid for this auction even after the multiplier has already been calculated.
When one auction ends, we will calculate the multiplier
based on totalTokens
and totalBids
. Then the bidders can claim auction tokens.
The problem is that users can end this auction when block.timestamp >= auctionEndTime
and users can bid/unbid this auction when block.timestamp <= auctionEndTime
. There exists one edge case, users can bid/unbid this auction and trigger auctionEnd
at the same block if block.timestamp == auctionEndTime
.
This will cause that malicious bidders can end this auction and then bid this auction to manipulate the auction token distribution ratio when block.timestamp == auctionEndTime
.
In below example, Bob is the only bidder before the auction ends. Bob bids 100 points for this auction.
And Cathy ends this auction and then also bids 100 points for this auction when block.timestamp == auctionEndTime
.
Cathy can claim all auction tokens and bob will not claim any token.
Malicious users can manipulate the auction result.
Manual
In order to avoid this edge case, please make sure that there is not any block that users can bid/unbid and also end auction.
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.