Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: high
Valid

Bidders are forced to settle if they are makers, and they can never settle

Vulnerability Details 🔍 && Impact 📈

In a trade where the ask side is the taker side, latter when settling only the bidder is authorized to do so. This makes no sense as bidder has no TGE tokens it is the asker side that has them.

See at settleAskTaker() here that the _msgSender() has to be the offer authority, yet bidder is the maker side creating the offer and thus its authority.

Latter tokens are also taken from _msgSender() which is the bidder side, see here.

The impact is that this won't be settled as the expected caller for settling this as of code is written now is the bidder and the bidder is the receiver of TGE tokens, not the settler.


Recommendations 🎯

Change the check on the if statement to:

if (status == MarketPlaceStatus.AskSettling) {
- if (_msgSender() != offerInfo.authority) {
+ if (_msgSender() != stockInfo.authority) {
revert Errors.Unauthorized();
}
}

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-PreMarkets-settleAskTaker-wrong-stock-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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!