An attacker can exploit this vulnerability by creating an offer, closing it, and then repeatedly calling the abortAskOffer()
function. This allows the attacker to retrieve their tokens multiple times, resulting in a loss of funds for the protocol.
Offer Creation (createOffer
): A maker creates an offer, locking tokens as collateral.
Offer Closure (closeOffer
): Then maker calls closeOffer()
, retrieves their locked tokens, and effectively cancels the offer.
abort ask offer (abortAskOffer
): After closing the offer, the maker calls abortAskOffer() again, which incorrectly allows them to retrieve the locked tokens a second time.
The abortAskOffer()
function fails to verify the offer's current status before executing the transaction. As a result, the maker can exploit this flaw to reclaim their tokens multiple times, effectively draining the protocol's funds without returning any points.
Maker Creates Offer: A malicious maker calls createOffer(), locking tokens as collateral.
Maker Closes Offer: The maker calls closeOffer() to retrieve the locked tokens, canceling the offer.
Double Refund Exploit: The maker then calls abortAskOffer(), exploiting the lack of proper state validation to receive an additional refund of their tokens.
The impact is critical. This vulnerability allows the maker to repeatedly withdraw funds, potentially leading to significant losses for the protocol.
Manual Review, Foundry
Implement a check within the abortAskOffer()
function to ensure that the offer is still valid and has not been closed before allowing the transaction to proceed.
Note, #148, #826, #1784 all stems from the fact that order statuses are not appropriately updated when a taker order is created against a maker offer. If the status is switched to `Ongoing/Filled` respectively, the virgin checks will fail appropriately and subsequently all this issues will be fixed. They could possibly be duplicates, so leaving open for appeal. This actually is closely related to issue #148. If a taker has created an Bid/Ask offer agains a original maker offer and the Status is adjusted to Ongoing/Filled accordingly, then the abortion/cancellations cannot occur so this issue cannot be exploited.
Note, #148, #826, #1784 all stems from the fact that order statuses are not appropriately updated when a taker order is created against a maker offer. If the status is switched to `Ongoing/Filled` respectively, the virgin checks will fail appropriately and subsequently all this issues will be fixed. They could possibly be duplicates, so leaving open for appeal. This actually is closely related to issue #148. If a taker has created an Bid/Ask offer agains a original maker offer and the Status is adjusted to Ongoing/Filled accordingly, then the abortion/cancellations cannot occur so this issue cannot be exploited.
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.