A vulnerability has been identified in the Swan smart contract where attackers can deny service to buyers by repeatedly relisting assets at zero price, avoiding paying fees while filling up the buyer's asset quota for a given round.
In Swan.sol
, the contract's relisting mechanism contains a significant vulnerability in how it handles zero-price relistings and royalty calculations. The relevant code section shows:
The vulnerability exists because:
Assets can be relisted at a price of 0
Royalty fees are calculated as a percentage of the price, so zero-price listings result in zero royalties
Each relisting adds another entry to assetsPerBuyerRound
regardless of price
No cost is incurred by the attacker when relisting at zero price
Previous listings remain in the array, contributing to the maxAssetCount
limit
An attacker can exploit this by:
Accumulating multiple unsold assets
Repeatedly relisting these assets at zero price
Avoiding any royalty payments due to the zero price
Filling up the buyer's asset quota for the round with zero-price listings
Buyers can be denied service for entire rounds
Legitimate sellers are blocked from listing assets
Platform royalty mechanism is circumvented
Zero cost to execute the attack (besides the transaction cost)
Manual Review
To address this vulnerability, consider implementing the following measures:
Minimum Price and Royalty Requirements
Fixed Relisting Fee
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.