buyFee And sellFee Should Be Known Before Purchase
The marketplace lets the buy and sell fees for a vesting plan be changed after a listing is created, so the fees a seller will pay are not fixed at listing time. A seller can therefore receive less revenue than expected if the seller fee is raised later.
Submitted by EPSec, also found by 0xhuh2005, BenRai, KupiaSec, rouhsamad, sl1, and typicalHuman
The platform allows the buyFee and sellFee parameters for a vesting plan to be modified after a listing is created. This creates a significant issue in terms of transparency and predictability for users engaging in transactions.
Impact on Users
-
Uncertainty for Buyers and Sellers:
Both buyers and sellers cannot reliably determine the exact fees associated with a transaction until the
spotPurchasefunction is executed. This lack of transparency diminishes user confidence in the platform. -
Financial Discrepancies for Sellers:
Sellers may receive less revenue than anticipated if the seller fee (
sellFee) is increased after the listing is created. This directly impacts their earnings and could lead to dissatisfaction or distrust in the platform’s fee structure.
Proof of Concept
Let’s have the following scenario:
- User A creates listing, currently the fees for this vesting plan are 1000 and 1000.
- After some period these fees are changed to 5000 for the seller fee and 1000 for buyer fee.
- User A will receive less money, because the fee is bigger.
Recommended mitigation steps
Consider two additional parameters to be added for the listing:
(uint256 bfee, uint256 sfee) = _getFees(_vestingPlan);
listings[_vestingPlan][listingId] = Listing({
seller: msg.sender,
total: _amount,
balance: _amount,
pricePerUnit: _price,
listingType: _listingType,
discountType: _discountType,
discountPct: _discountPct,
listTime: block.timestamp,
whitelist: whitelistAddress,
currency: _currency,
minPurchaseAmt: _minPurchaseAmt,
status: Status.LIST,
vestingPlan: _vestingPlan,
+ buyerFee: bfee,
+ sellerFee: sfee
});
emit Listed(_vestingPlan, listingId);
}
Also make the changes to the Listing struct and spotPurchase to use the correct fees.
TechticalRAM (SecondSwap) acknowledged
calvinx (SecondSwap) commented:
We will show this in UI as fees can be negotiated and set later
I think the issue here is, no protection for the user in case fee changed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the listing does not store the fee values at creation time, so the purchase reads whatever fee the vesting plan currently has.
Impact
Sellers could receive less revenue than anticipated, and neither buyers nor sellers can know the exact fees until the purchase executes.
What the attacker needed
A listing on the marketplace; fees changed after listing
The fix
The listing should record the buyer and seller fees at creation time and the purchase should use those stored values.
How it was found
- A user creates a listing while the vesting plan fees are set to certain values.
- After some time the seller fee is increased.
- The user receives less money because the fee is now larger.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A seller lists tokens for sale and expects a certain amount of money after the platform takes its cut. The problem is that the platform's cut can be changed after the listing is made, so the seller may end up with less than they planned. Buyers and sellers only learn the real fee when the purchase actually happens.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.