Summary
The startAuction() function in DaiGoldAuction can be called repeatedly right after the contract deployment, leading to tokens being stuck permanently. This occurs due to a lack of proper validation checks on the initial state, allowing the function to bypass necessary cooldown periods and start auctions prematurely.
Code Reference:
Vulnerability Details:
The startAuction() function does not validate the initial state right after contract deployment, leading to the possibility of starting multiple auctions in quick succession, without the onlyElevatedAccess
first calling setAuctionConfig
. The function startAuction()
checks if the previous auction has ended and ensures a cooldown period between auctions. However, these checks can be bypassed right after deployment because the initial state does not have a previous auction, allowing the function to start new auctions without proper cooldowns.
In the DaiGoldAuction
contract after deployment, the protocol is supposed to first set the auction config even before a user can call startAuction()
, but because of the lack of check in the contract any user can start calling startAuction right after contract deployment
Impact:
Allowing repeated calls to startAuction() immediately after deployment can have severe consequences such as token been locked up in the contract forever and also contract functionality been compromised, making the contract unusable.
Proof of Concept:
The lack of validation for the initial state allows repeated calls to startAuction() as demonstrated in the following scenario:
Deploy the DaiGoldAuction contract.
do not call the setAuctionConfig at this moment
Call startAuction() repeatedly without waiting for the cooldown periods.
Recommended Mitigation:
To prevent repeated calls to startAuction() right after deployment, it is recommended to implement additional validation checks to handle the initial state appropriately. This can include setting up a duration before the first auction can start
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.