In SpiceAuction
contract, recoverAuctionTokenForZeroBidAuction is meant to be used to recover the auction tokens when the auction epoch ends with no bid. The following check ensures that no bids were done for the auction:
However, this is not efficient and can be abused. A malicious actor monitoring the chain and seeing an auction is very close to an end with no bids can frontrun the bid transaction just before the epoch ends and bids with the smallest value possible, i.e 1 wei DAI, making epochInfo.totalBidTokenAmount
greater than 0, and thus recoverAuctionTokenForZeroBidAuction
can not be called. As consequences:
The actor will get the whole auction tokens (which might be large) for 1 wei DAI, which is economically inefficient. Those tokens were meant to be recovered using recoverAuctionTokenForZeroBidAuction
.
The malicious actor can choose to not claim if he is not interested at all (as his attack did not cost him, only gas + 1wei DAI), locking the auction tokens permanently.
Note that the malicious actor who bidded at the very end did not have an intention to bid, as he can bid just for 1 wei of DAI, but he wanted to abuse the recoverAuctionTokenForZeroBidAuction
, making it completely useless
The following PoC demonstrates the described finding, where 100 ether
of auction tokens can either be locked or claimed for 1 wei DAI only. Copy and paste the following function in test/forge/templegold/SpiceAuction.t.sol
:
Malicious actors can permanently lock auction tokens for auctions that were supposed to end with no bids
Actors monitoring the chain can claim all auction tokens (that were meant to be recovered because of no bids) for 1 wei DAI
recoverAuctionTokenForZeroBidAuction
might never be used.
Manual Review
One possible mitigation could be to force a minimum bid amount for auctions with no bids and are very close to an end.
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.