The marketplace contract is vulnerable to frontrunning attacks where malicious actors can monitor the mempool for unlistNFT() transactions and force unwilling sales by frontrunning with buyNowPrice purchases. When a seller decides to unlist their NFT (due to changed market conditions, personal reasons, or pricing errors), attackers can observe the pending unlisting transaction in the public mempool and submit a purchase transaction with higher gas fees to execute first. This forces the seller to complete a sale they no longer want to make at potentially unfavorable terms.
Seller lists NFT with minPrice and buyNowPrice set (e.g., 1 ETH each)
Market conditions change or seller changes mind and calls unlistNFT(tokenId)
Attacker monitors mempool and detects the unlisting transaction
Attacker immediately submits placeBid(tokenId) with msg.value >= buyNowPrice and higher gas price
Attacker's purchase transaction executes first due to higher gas fees
NFT is sold to attacker via buy-now mechanism before unlisting can occur
Seller's subsequent unlistNFT() transaction fails because NFT is no longer listed
Seller is forced to complete unwanted sale, potentially at below-market price
Sellers cannot reliably withdraw their NFTs from the market when circumstances change
Attackers can acquire NFTs at stale prices when market conditions have improved
Sellers may be forced to sell at prices below current market value
Implement a commit-reveal scheme for unlisting operations to prevent frontrunning by hiding the seller's intention until execution
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.