In the PreMarkets contract, makers can create offers that takers can accept by paying a platform fee and trade tax. If the maker aborts the offer using abortAskOffer(), they are refunded their collateral and keep the trade tax, while the taker loses the platform fee and trade tax.
This allows malicious makers to repeatedly profit at the expense of takers by creating offers, waiting for takers to accept, and then aborting the offers to retain the trade tax without any risk.
Makers can exploit this flaw to gain risk-free profits, leading to unfair losses for takers.
Maker creates an offer for 100 points at 1 ETH.
Taker accepts the offer, paying 1 ETH + platform fee + trade tax.
Maker aborts the offer using abortAskOffer(), retaining the trade tax.
Taker aborts their position using abortBidTaker() but loses the platform fee and trade tax.
Add this PoC to test/PreMarkets.t.sol and run forge test --mt test_PoC_CreateOffer_Steal_TradeTax -vvvv:
[!NOTE]
For brevity the simplest PoC has been included, but this works for both Protected and Turbo offers, and due to another bug, maker can always abort their offer.
Modify the abortAskOffer() and abortBidTaker() functions to refund the trade tax and the platform fee paid to the taker when the offer is aborted by the maker.
Valid high severity, given orginal offer makers are not a trusted entity to enforce a settlement. The trade tax set by the maker should be returned back to the takers to avoid abuse of abortion of ask offers to steal trade tax from takers. Note for appeals period: See issue #528 for additional details
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.