One seller can fill maxAssetCount for one Buyer by calling swan::list(asset, buyer) multiple times in a single transaction making buyer unable to receive offerings from another sellers leading to Denial of Service and forcing buyer to buy one of attacker's assets
The vulnerability lies because there is no limit of offerings a seller can make to a buyer for a round.
An attacker could deploy a smart contract (C), monitor the mempool and when some new buyerAgent (A) is deployed or one buyerAgent (A) enter in sell phase it could use C to call swan::list(asset_properties, A) n times, where
n = maxAssetCount = swan::getCurrentMarketParameters().maxAssetCount
filling the amount of offerings the buyerAgent (A) could receive for round.
So when another seller tries to list an asset for the buyer in current round it will revert leading to DoS and forcing buyer to buy one of attacker's assets.
The following Proof of concept shows the described above with the scenario:
Attacker deploys smart contract C
User buyerAgent A enter in sell phase
Attacker uses C to call swan::list(asset_properties, buyerAgent) n times
buyerAgent offering capacity is filled by C
When another seller tries to list to buyerAgent it will fail.
First create SellerCt.sol in contracts folder:
Add the following test case in Swan.test.ts under Sell phase section:
Execute test and observe that after attacker uses contract to fill buyer offers capacity no one else could list assets for buyer
Severity: High due to this flaws makes unable to list assets for a buyer and because buyer is ultimately forced to buy an attacker asset
Manual Review
There should be a limit of how many asset can a seller list for buyer in a round
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.