The offerInfo.authority is incorrectly allowed to call the DeliveryPlace.settleAskTaker() function when, in fact, only the stockInfo.authority should be permitted.
In the DeliveryPlace.settleAskTaker() function, the access control check is implemented as follows:
The settleAskTaker() function is intended to be used by the Taker of a Bid offer to settle Points with the Maker of that offer.
However, with the current access control, the function forces the Maker to transfer Points tokens to themselves as part of the settlement, as shown below:
This issue is problematic because it allows the Maker to craft a Bid offer that can result in stealing funds from any Taker of such an offer. Here is how this can happen:
The Maker creates a Bid offer stating that they want to buy X Points for 1000 USDC and sets the collateral factor to 200%.
A Taker accepts the Bid offer and transfers 2000 USDC as collateral in exchange for 1000 USDC and a promise that they will settle X Points with the Maker after the TGE.
After the TGE, the Taker is unable to settle because they do not have access to the settleAskTaker() function. Instead, the Maker calls the function with a 0 amount, stealing all the collateral and leaving the Taker with a 1000 USDC loss.
Incorrect access control.
Loss of funds.
Manual review.
Fix the access control check:
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.