The Swan::list
serves as a core feature of the Swan protocol, allowing sellers to earn by listing NFTs for their target
agents. However, it lacks the proper spam protection checks allowing attackers to spam listings
mapping with assets of negligible _price
, thereby skipping the royalty & platformFee that they have to pay, causing DOS for other sellers and earning in the process. This allows users to take advantage of the if statement
below,
spamming the listings[asset]
with assets, providing bare minimum _price
. Lack of a minPrice check for listing assets allows attackers to achieve the following,
Fill the maxAssetCount
quota causing DOS for legitimate sellers.
List assets without paying royalty & platform fee.
The core of this vulnerability is rooted in absence of a minimum _price
check for listing the asset. Zero transfers do not
revert so uint256 buyerFee = (asset.price * asset.royaltyFee) / 100;
becomes 0 in transferRoyalties
if asset.price
is a negligible amount. If the buyerFee
becomes 0, driaFee
becomes 0. This means nothing would be sent to buyer. The Swan owner would not earn their driaFee, attacker would essentially list for free by only paying the gas fee, legimitate sellers wouldn't be able to list their assets, thus disrupting the core functionality of the protocol.
Attackers can list assets of negligible _price
which would rob buyers of royalty, spam the protocol without incurring
significant costs, disrupting the service for legit sellers thereby monopolizing the listing quota.
Attacker spams the listings by providing assets with negligible _price
value.
Since the asset _price
provided is negligible, the buyerFee
& driaFee
becomes 0 so no royalty & driaFee is paid.
Seller1 tries to list their asset, but the transaction reverts since maxAssetCount
quota is filled as a direct result of spamming.
BuyerAgent purchases assets and attacker earns the asset values.
Add the test in swan.test.ts
,
Manual Review & Hardhat testing
Consider adding a minPrice
threshold that sellers should abide by. That would ensure that, even if attackers spam the listings[asset]
, the price of asset is adequate to cover royalty & platformFee.
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.