Since the purchase
function in BuyerAgent.sol
is callable by the operators, the operators can just list an asset at a very high price and call the purchase
function. This would cause the operators to steal the buyers funds deposited.
In the BuyerAgent.sol
the authorized people are the owner and the operator. Therefore the operator can list a useless asset to the buyer at a high price and then proceed to purchase this asset. Which will result in the entire funds trasnferred to the operator.(except a part of the royaltyFee).
function purchase() external onlyAuthorized {
(https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/BuyerAgent.sol#L222C1-L222C50)
Complete loss of funds to the user. But it is mentioned that the operator is trusted.(not sure what is the severity)
Manual Review
Make the purchase function accessible only to the owner.
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.