Due to a wrong validation to check a caller (_msgSender()
) of the PreMarkets#abortBidTaker()
, an unexpected-caller (stockInfo.authority
) can freely abort a bid taker.
(On the other hand, when an eligible caller (preOfferInfo.authority
) call the PreMarkets#abortBidTaker()
, the TX can be reverted)
Within the PreMarkets#abortBidTaker()
, the TX can be reverted - if a caller (_msgSender()
) is not a stock owner (stockInfo.authority
) like this:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L649-L651
According to the NatSpec of the PreMarkets#abortBidTaker()
above, a caller (_msgSender()
) is supposed to be an offer owner (preOfferInfo.authority
) like this:
@notice Only offer owner can abort bid taker
However, within the PreMarkets#abortBidTaker()
above, a caller (_msgSender()
) must be a stock owner (stockInfo.authority
). Otherwise, the TX can be reverted like this:
https://github.com/Cyfrin/2024-08-tadle/blob/main/src/core/PreMarkets.sol#L649
This discrepancy allow an unexpected-caller (stockInfo.authority
) to be able to freely abort a bid taker - because the unexpected-caller (stockInfo.authority
) can permissionlessly call the PreMarkets#abortBidTaker()
.
(On the other hand, when an eligible caller (preOfferInfo.authority
) call the PreMarkets#abortBidTaker()
, the TX can be reverted)
Foundry
Within the PreMarkets#abortBidTaker()
, consider replacing the stockInfo.authority
with the preOfferInfo.authority
in the if-statement like this:
Invalid. 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). Hence, we should verify `stockInfoMap`, regardless of the taker order being a ASK (selling points) or BID (buying points) taker order, so there is no issue here, other than documentation error
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.