A critical flaw in the SwanManager::setMarketParameters()
function allows unintended phase transitions in the Swan protocol. Changing market parameters can inadvertently skip critical trading phases, such as moving directly from the SELL phase to the WITHDRAW phase without allowing for a BUY phase.
The vulnerability stems from the immediate application of updated parameters in the getRoundPhase()
function within the BuyerAgent contract. If setMarketParameters
updates the market intervals mid-cycle, the function might interpret the current time as part of a new cycle based on the updated parameters, potentially skipping phases.
When market parameters are altered mid-cycle and durations are reduced, it can disrupt the protocol's standard operational flow. This may skip Buy Phase which does not only impacts the trading cycle but also skips crucial transactions that are integral to the protocol's system.
Manual review
Implement a mechanism where parameter updates take effect only at the start of the next cycle rather than immediately.
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.