This issue arises because the contract does not correctly update the abortOfferStatus when a sub-offer is listed, which enables some seller to bypass collateral requirements.
When a buyer relist stock points he buy from an ask offer in Turbo mode, the contract should change the abortOfferStatus to AbortOfferStatus.SubOfferListed to prevent the maker from aborting their offer. However, the current implementation does not correctly update offerInfo.abortOfferStatus.
In the current code, when an offer is sublisted in turbo mode, offer.abortOfferStatus should be updated as follows:
However, this code does not effectively update the state of the originOffer, allowing the maker to abort their offer even after relisting.
The issue arises because the code that attempts to update the abortOfferStatus does not actually modify the persistent state of the contract. Specifically, the originOfferInfo is a local variable in the function, and while it appears to be updated within the function, these changes do not affect the actual storage in the contract.
alice create an ask offer in turbo mode
alice buy points from her own offer
Alice relists the points she bought in a new ask offer
Alice aborts her offers:
Alice then calls abortAskOffer and abortBidTaker to cancel her original ask offer and the bid taker, which should not be allowed if a sub-offer is listed.
Alice withdraws all her funds:
After aborting, Alice withdraws all her collateral and funds, effectively creating a new ask offer without locking any collateral.
The vulnerability allows users to create and maintain offers without locking any collateral, leading to financial losses for other users, enabling market manipulation, and undermining the platform's trustworthiness.
manual review, foundry
To ensure the correct persistence of the abortOfferStatus in Turbo mode, the code should be modified to update the storage variable directly. The following change can be made:
Valid high severity, because the `abortOfferStatus` of the offer is not updated and persist through `storage` when listing an offer for turbo mode within the `offerInfoMap` mapping, it allows premature abortion given the `abortOfferStatus` defaults to `Initialized`, allowing the bypass of this [check](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L552-L557) here and allow complete refund of initial collateral + stealing of trade tax which can potentially be gamed for profits using multiple addresses
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.