Swan::list doesnt check that buyer was deployed using BuyerAgentFactory so, if buyer is a custom contract it can avoid paying royalties and bypass all requirements when buying an asset
Swan::list allows sellers to make offerings to arbitrary addresses allowing _buyer to be a custom contract because it doesnt check that buyer is a buyerAgent ie was deployed using BuyerAgentFactory.
If _buyer is a custom contract then it can avoid paying royalties and bypass all timing requirements on swan::purchase.
The following Proof on concept show the issue described above with the following scenario:
Attacker deploys a custom buyer contract (C) to be used on swan
Seller list item for contract C using swan::list(asset_properties, C)
Attacker uses C to buy asset without paying royalties and without waiting anytime bypassing swan purchase restrictions using C to call swan::purchase.
Proof of concept:
First save the modified buyerAgent contract in contracts/BuyerAgentMod.sol file:
Next add the following test case under sell phase section in test/Swan.test.ts
Execute the test and observe that attacker can use a smart contract to buy an asset avoid paying royalties and bypassing timing requirements
Severity: High due to exploiting this vulnerability allows to buy assets avoid paying royalties and bypassing all requirements
Manual Review
Swan should have a mapping of deployed buyerAgents and check if buyer address is there on swan::list function
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.