The placeBid function is vulnerable to reentrancy when processing buy-now purchases. After setting the bid and marking the listing as not listed, the function calls _payout to refund the previous bidder before calling _executeSale. The _executeSale function then transfers the NFT and makes another external call to pay the seller. A malicious previous bidder could reenter through their receive function and exploit the inconsistent state where the listing is marked as unlisted but the NFT hasn't been transferred yet.
Likelihood:
This occurs whenever a buy-now purchase is executed on a listing that already has an existing bid, since the contract refunds the previous bidder through _payout before completing the NFT transfer.
A malicious previous bidder can exploit the refund callback via their receive() function to reenter the contract during this window, while the listing is already marked as unlisted but before _executeSale finalizes the transfer and payments.Impact:
A malicious bidder could potentially manipulate the auction state during reentrancy, possibly causing the NFT transfer to fail or manipulating the fee calculation. While the immediate financial impact is limited due to the state changes already made, it could cause accounting inconsistencies or DoS conditions.
Add reentrancy guard or restructure to follow checks-effects-interactions
BidBeast Marketplace has a Medium-severity reentrancy vulnerability in its "buy-now" feature that allows an attacker to disrupt the platform by blocking sales or inflating gas fees for legitimate users.
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.