In the DeliveryPlace contract, there is an important inconsistency between the documented behavior and the actual implementation of authority checks in the settleAskTaker
function.
The comment states: "caller must be stock authority"
The implementation checks for offer authority
This discrepancy suggests that the implemented authority checks may not align with the intended access control design. The presence of correct stock authority checks in other parts of the contract further indicates that these functions may be incorrectly implemented.
The potential impacts of this vulnerability include:
Unauthorized Access: Incorrect authority checks could allow unauthorized parties to settle ask takers, potentially manipulating the market or causing financial losses.
Inconsistent Behavior: The discrepancy between different function's authority checks could lead to unpredictable and inconsistent contract behavior.
To address this vulnerability, we recommend the following steps:
For settleAskTaker
: Change the authority check to use stockInfo.authority
:
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.