Bids in DaiGoldAuction
for the current auction epoch are allowed only when the epoch is at active state, as confirmed by canDeposit view function:
However, if we inspect the bid function we can see that there is no check if the current epoch is at active state:
As a result, users can bid at cooldown periods or even when the epoch has ended. This will lead to multiple consequences:
Users bidding on the cooldown period will permanently lose their DAI without having the possibility to claim TGLD if a recovery happens for the current epoch. That is because when the recovery happens the epoch data is deleted and the auction token amount is added to the next epoch:
So, users who have already made bids for this current epoch (that was deleted because of the recovery) will have neither a way to recover their DAI nor a way to claim TGLD
If a recovery happens on the current epoch, the epoch data is deleted but the _currentEpochId
is not incremented. However, users can still bid on the current invalid epoch (that is deleted), and similarly to the first consequence, users have no way to claim TGLD and no way to recover their DAI
Because users can bid after the current epoch ends, they might abuse the system leading other users to claim an unexpected amount of TGLD. That is because, when the current epoch ends, users call claim
to claim their TGLD, and the amount to receive depends on the following formula:
So, after the auction ends, all the parameters in the formula above should be constant; thus, the claiming amount should be predictable. However, because someone can bid after the current auction ends, a malicious actor can front-run claiming transactions to make a bid and thus increment info.totalBidTokenAmount
, leading users to receive an unexpected amount of TGLD.
The following finding has two impacts as illustrated above:
Permanent lost of DAI without a way to claim TGLD
Malicious actors might abuse the claim system, leading users to receiving unexpected amount of TGLD
Manual Review
Consider allowing bids only when the current epoch is active. Below is a suggestion for an updated code of the bid
function:
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.