Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Valid

Sellers Should Be Whitelistable

Summary

In the current implementation of Swan::list, sellers can list new SwanAssets, but there is no restrictions on who can be a seller. This allows a malicious seller to spam the asset list with dummy assets, potentially filling the buyer's list with low-priced assets that the buyer may be forced to purchase.

Vulnerability Details

Scenario:

  1. Suppose a buyer enters a round with a limit of 10 assets, but currently has no assets listed for purchase.

  2. A malicious seller could then list dummy SwanAssets with prices just below the protocol fee threshold (e.g., a price of 9 if the fee is 10), effectively bypassing fee requirements.

  3. This fills the buyer’s asset list with low-value dummy assets, which could force the buyer to spend on undesired assets.

Impact

This vulnerability allows malicious sellers to spam the buyer’s asset list, potentially leading to:

  • Resource waste within the protocol by flooding the listing mechanism.

  • High costs for buyers who may be forced to purchase low-value, unwanted assets.

  • Increased risk of DoS attacks as spamming limits the availability of valid assets for genuine sellers and buyers.

Tools Used

Manual Review

Recommendations

Implement a seller whitelisting mechanism to ensure only approved sellers can list assets, preventing spam listings and preserving the protocol’s integrity. Additionally, include asset validity checks to prevent listings that circumvent protocol fees.

Suggested Implementation

Add whitelisting and validation checks in Swan::list as follows:

function list(string calldata _name, string calldata _symbol, bytes calldata _desc, uint256 _price, address _buyer)
external
{
// Ensure only approved sellers can list assets
+ require(isWhitelistedSeller(msg.sender), "Seller is not whitelisted");
}
// Whitelist function for approved sellers
+function isWhitelistedSeller(address seller) internal view returns (bool) {
+ return approvedSellers[seller];
+}

The same logic should be applied for the relist function.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

DOS the buyer / Lack of minimal amount of listing price

Appeal created

petersr Submitter
12 months ago
inallhonesty Lead Judge
12 months ago
inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

DOS the buyer / Lack of minimal amount of listing price

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.