The protocol allows the creation of the same offer multiple times using identical CreateOfferParams
, leading to potential loss of user funds due to bypassed checks for existing offers.
Same Offer Can Be Created Multiple Times Using the Same CreateOfferParams
The protocol allows the creation of the same offer multiple times using identical CreateOfferParams
, leading to potential loss of user funds due to bypassed checks for existing offers.
When creating an offer, the maker address, offer address, and stock address are generated using the offerId
. A value of 1 is added to the offerId
previously used to generate the address, which is then used to update maker, offer, and stock information, as shown below:
The following updates occur in the respective mappings:
When creating another offer using the same CreateOfferParams
, the checks to determine whether the maker, stock, or offer already exists will be bypassed because the makerAddr
, offerAddr
, and stockAddr
stored in the mapping were generated using a different offerId
.
The same offer can be created multiple times, leading to a potential loss of user funds.
Manual Review
Update the offerId
before generating the addresses and storing them.
I believe this is valid low severity, although there is inconsistency here when using the correct `offerId` for assigning offerIds and generating the unique addresses as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L67-L69), this is purely an accounting error for offerIds. If we generate the offerId using current `offerId - 1`, the appropriate listing/taker orders can still be created against those offers.
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.