Subsequent ask offerCreator of turbo type also receives initialCollateralToken
A user can buy
an askOffer of turboType
and list it again without paying any collateralToken
because it was already paid by initial offer creator.
Once the initial offer creator settles
the askOffer using deliveryPlace:settleAskMaker()
then he receives back his initialCollateralToken
, but the problem is second owner(who bought the initial offer & listed it again) also receives the initialCollateralToken
when he settles the askOffer using deliveryPlace:settleAskMaker()
, even though he didn't
pay any collateralToken to list because it was a turboType.
//Here is how this works
Suppose user created an ask offer of 1000 points with 1000e18 amount(collateralToken) at 10000(100%) collateralRate. And for this user will pay 1000e18 collateralToken to capitalPool as deposit
User2 bought all 1000 points paying 1000e18 collateralToken(ignore tradeTax & plateFormFee) & this 1000e18 collateralToken added to user balance as SalesRevenue
User2 listed it again with 1000e18 amount at 10000(100%) collateralRate without paying any collateralToken as this was turboType
Owner updated the marketPlace with tokenPerPoint = 1e18
User settled the askOffer(using deliveryPlace:settleAskMaker()) with 1000 settledPoint ie paying 1000 pointsToken to capitalPool(which will go to user2 as he bought all points) & successfully receiving back his 1000e18 collateralToken which he paid while creating offer(step 1)
User2 also settled his askOffer(which he created at step 3) with 0 settledPoint(because there was no buyer, so no usedPoints) ie paying 0 pointsToken, but successfully receving 1000e18 collateralToken as initialCollateralToken which he never paid as this was turboType
Also when user2 closed his bidTaker(which he bought in step 2) then he receives 1000e18 pointsToken, which was paid by user while setteling askOffer(step 5)
//Here is PoC which shows the above situation
As we can see user2 also receives 1000e18 collateralToken, which only initialOffer creator should get, along with 1000e18 pointsToken.
This is issue is happening in deliveryPlace:settleAskMaker() because it fails
to check if the offer is originOffer
or not
Note: If you see pointsToken balance of user2 as 0, its because there a mismatch of address(submitted as another issue) in closeBidTaker(), which updates the pointsToken at collateralToken address
Subsequent offerCreators also receive collateralToken, which they didn't paid
Manual Review
Add this check in settleAskMaker()
, which checks if the offer is originOffer or not
Valid high severity, this allows resellers listing offers via `listOffer/relistOffer` to game the system. Based on the inherent design of Turbo mode not requiring takers making ask offers for the original maker offer to deposit collateral, the wrong refund of collateral to takers even when they did not deposit collateral due to turbo mode during settleAskMaker allows possible draining of pools.
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.