The settleAskTaker
function is expected to be call by the taker, as they are the one who will be selling the points, during AskSettling status.
But the function implements an incorrect access control where it only makes the function to be callable authority of the offer, which is the one who has directly created the offer to buy points.
As a result of which the taker can never sell points to the bid offer maker, due to the function reverting when taker calls it.
The vulnerability is present in the settleAskTaker
function where it allows the offer's maker (authority) to call the function instead of the offer taker.
The AskTaker is the person who will be selling the points to the offer's authority (i.e. its direct maker), and it is expected that the function to be callable by AskTaker so that they can settle the PointToken to the offer's authority.
But due to incorrect access control check the function doesn not allow the ask taker to call it and no token points trade can be made.
The function allows the offer's authority to call it and tt is insignificant to allow the authority of offer maker which has placed a buy offer to call the function.
The incorrect code snippet is below:
Here offerInfo.authority will be the direct maker of the offer, and they expect the taker (i.e. authority of stockInfo) to allocate the point tokens to them as a result of which the function only allowing them will make the trade to never happen.
The taker (AskTaker or stockInfo.authority) will never be able to call function, as a result of which PointToken cannot be allocated to the direct offer maker.
Manual Review
Perform the updation:
Valid high severity, when taker offers are created pointing to a `offer`, the relevant `stockInfoMap` offers are created with the owner of the offer aka `authority`, set as the creater of the offer, as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L245). Because of the wrong check within settleAskTaker, it will permanently DoS the final settlement functionality for taker offers for the maker that listed the original offer, essentially bricking the whole functionality of the market i.e. maker will always get refunded the original collateral, and takers will never be able to transact the original points put up by the maker. This occurs regardless of market mode.
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.