A critical vulnerability exists within the interaction between the BuyerAgent and Swan contracts, allowing the BuyerAgent to bypass phase checks and purchase assets outside of the designated buy phase.
The BuyerAgent contract has a purchase function designed to check that the transaction is occurring within the buy phase of the market cycle before proceeding with the purchase. This is done via the _checkRoundPhase(Phase.Buy) function which confirms it's the correct phase for buying.
The Swan contract's purchase function does not independently verify the market phase but only checks if the caller (msg.sender) is the intended buyer of the asset:
The vulnerabiity arises when the BuyerAgent directly calls the purchase function in the Swan contract bypassing the Phase Check.
The BuyerAgent can potentially initiate purchases at any time, bypassing business logic meant to restrict purchases to specific market phases.
Manual Review
Implement phase checks within the Swan contract to prevent actions during inappropriate phases.
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.