Malicious user can rug pull or honey pot the honest users/protocol because there is no incentive for malicious user to call delivery::settleAskMaker() offer
A user can create ask offer using preMarket:createOffer() by giving collateral. When another user creates taker using preMarket::createTaker() then originalOffer's owner gets tradeTax & salesRevenue
Now the problem is, tradeTax + salesRevenue generated for originalOffer's owner is greater than the collateralAmount that owner put in initially while creating ask offer. This tradeTax + salesRevenue can be withdrawn by owner immediately leaving no incentive for owner to call settleAskMaker().
If owner didn't call settleAskMaker() then his initialCollateral will be used to pay the buyers, but the problem is buyers will only get transferdAmount(which was actually paid to buy points) not the tradeTax & platformFee which they pay while creating taker, which is loss for the honest users.
A malicious user can create ask offer for a popular maketPlace with low amount & high tradeTax and let people trade for those points. Once all points are sold or enough(more than initial depositCollateral) tradeTax & salesRevenue is generated then malicious user can withdraw all token & never call settleAskMaker(), making a loss for buyer with tradeTax & platformFee
//Here is PoC which clearly shows owner gets more tokens than he deposited initially as collateral, also he can withdraw those tokens & never call settleAskMaker(), successfully rug pulling honest users
Note:- I've not shown withdrawing those token in this test because tokenManager:withdraw() is broken & I've submitted that as different issue. If we fix those issue we can withdraw.
In the above test we can see, malicious user deposited only 1000e18 tokens as initialCollateral for 1000 points but generated 1030e18 tokens through tradeTax & salesRevenue, which is 3% greater than initialDeposit amount.
Now owner can withdraw these tokens & has no incentive to call settleAskMaker() for buyers & pay them pointsToken. This 3% is just free money for malicious user, also this 3% can go high because this comes from eachTradeTax(which is in malicious user hand)
Malicious user can rug pull honest user, making then loss for tradeTax & platformFee
Manual Review
There are couple of recommendations:
Require the collateralRate to be 120% or 130% for creating offers initially because owner can create offer with just 10000(100%) collateralRate, this will increase the initial collateral depositAmount from owner
Allow only salesRevenue generated from taker to withdraw but not tradeTax
Valid high severity, because the collateral rate utilized when creating an offer is stale and retrieved from a previously set collateral rate, it allows possible manipilation of refund amounts using an inflated collateral rate to drain funds from the CapitalPool contract
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.