The FjordAuction
uses incorrect comparators which makes them vulnerable to timestamp
-based attacks.
The FjordAuction
allows bidders to bid
and unbid
whilst the auction is ongoing, however once the auction's bidding timeframe has elapsed, it should not be possible for buyers to modify their positions, and the outcome of the auction should be respected.
However, these controls are implemented incorrectly:
Due to these incorrect comparisons, it is possible for a user to bid on a closed auction at precisely at the end time (i.e. by incentivising the vulnerable block.timestamp
to equal auctionEndTime
via PBS, since block proposers can influence the block timestamp).
An attacker can trigger auctionEnd
at precisely the auctionEndTime
, and place a bid on the auction within the same block. This would allow the attacker to lock in pre-bid multiplier
, and their additional bidAmount
would not get taken into account since a more favourable multiplier
is already locked.
Their ability to achieve a higher multiplier
through the lack of accounting of the contribution of their tokens would invariably lead to another bidder being unable to redeem their tokens after the attacker has claimed their malicious earnings.
The auction becomes insolvent.
By closing the auction and bidding at precisely the auctionEndTime
, an attacker can redeem the bidAmount
for a higher number of tokens than deserved, whilst leaving honest bidders at a loss.
Manual Review
Correct the comparisons and don't allow any bid
ding or unbid
ding once the auction is closed:
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.