The protocol design intends for auctions to occur sequentially, limiting configuration operations to the two most recent epochs to ensure reliability and predictability of auction settings. Theoretically, new auction configurations should only be added after the previous auction has fully concluded.However, the current implementation of SpiceAuction::setAuctionConfig
contains a vulnerability:
It correctly restricts adding new auction configurations when an auction is active.
It fails to prevent setting new configurations during the auction's cooldown period.
This code only prevents setting new auction config when the current auction is in an active state. This check would erroneously pass when the auction is in a cooldown state. Logically, if setting a new config is not allowed in the active state, there is no reason for it to be allowed during the cooldown period.
Place the following test into SpiceAuction.t.sol::SpiceAuctionTest
. This test demonstrates how the flaw in SpiceAuction::setAuctionConfig
affects the normal operation of SpiceAuction::removeAuctionConfig
. The removeAuctionConfig
function is expected to delete the most recent AuctionConfig that hasn't started or is in the cooldown period. Under normal circumstances, if the current Auction is in cooldown, we would expect it to remove this Auction. However, in this example, its behavior differs from the expected outcome.
This behavior may lead to the following issues:
Breaching the protocol's expected limitations on auction configuration operations.
Potentially altering rules after an auction has effectively begun, introducing unfairness.
Reducing system predictability, possibly causing confusion and distrust among participants.
The above case highlights a potential vulnerability in the contract's logic for managing auction configurations, which could lead to unexpected state changes and potential exploits.
Manual Review.
Replace info.isActive()
with info.hasEnded()
in the setAuctionConfig
function. Ensure that new auction configurations can only be set when the current auction or the previous auction has completely ended. Prevent setting new configurations once startAuction()
has been called for the current auction.
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.