In turbo settle type, the maker is the only person who deposit some collaterals. So the maker should be the only person who can settle ask maker and get back the collateral. But now the listOffer's owner can trigger settleAskMaker() to settle and get back some collateral. This will lead that the maker cannot get back all collaterals.
In Turbo settle type, the maker will add some collateral to create one ask offer. Traders can bid this offer to buy some points. And these takers can resell their points bought from the maker via listOffer() with 0 collateral because of the turbo mode.
When the market's status is changed to asksettle, the maker will settle this to get back the collateral via settleAskMaker(). All takers who still hold some points can get the point token via closeBidTaker().
The problem exists in settleAskMaker(). One resell offer(via listOffer())'s owner can still settle this offer to get some collateral via settleAskMaker() in turbo mode. And these collateral belongs to the maker, the original offer owner. This will lead the maker lose some collateral.
One possible attack vector:
Alice creates one ask offer as the maker, deposit 10000 collateral token to sell 1000 points.
Bob creates one taker to buy 500 points via Alice's offer.
Bob resell his points via listOffer().
Cathy create one taker to match the bob's offer.
MarketPlace's status is changes to asksettle.
Bob call settleAskMaker() to settle his offer to get some collaterals. Bob withdraws the collateral from the TokenManager.
Alice calls settleAskMaker() to settle her offer to get back all collaterals. Although the account's balance is updated in userTokenBalanceMap. But maybe there is not enough collateral token in capitalPool to withdraw.
In below test case, user2 is not the maker, users buy points and resell points. When the markerplace's status is changed to the asksettle status, users can settle his offer to get back some collaterals.
Maker's collateral will be withdrawn by others. Makers may have to take the loss.
Manual
In turbo mode, only the maker or the original offer's owner can trigger settleAskMaker()
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.