The BidBeastsNFTMarket::placeBid function lets users place bids on BidBeasts NFTs and refunds users that gets outbid.
Since the placeBidfunction does not have reentrancy guard it enables an attacker to reenter when a user outbids the attacker contract. This is possible because the function refunds the prevous bidder using a raw call{value: ...}("")without nonReentent.
Likelihood:
Attacker only needs to deploy a simple contract with a receivefunction that calls placeBid.
Once an attacker is previous bidder, they can repeatedly reenter to remain the highest or greif many auctions.
Can be executed in Foundry/Hardhat scripts by any attacker.
The marketplace routinely accepts contract bidders, so the refund callback surface is realistic.
Impact:
A malicous bidder can always (or until the buy now price is met) reclaim the highest bid position within the same transaction, discouraging honest bidders and undermining auction fairness.
Attacker can repeatedly reenter to extend auction deadline, waste gas for honest participants, or lock asset in prolonged auctions.
By controlling the bidding sequence , attacker can suppress genuine competion and potentially acquire NFTs at artificially low prices.
Flow:
Attacker deploys a contract with a receivefunction that calls placeBid.
Attacker makes a bid with the deployed contract.
An honest bidder outbids the first bid.
When placeBidfunction refunds the malicious contract it reenters and makes a higher bid.
Add this contract to the test suite:
Add this test to the test suite:
The test asserts that the highest bidder is the malicous contract, outbidding BIDDER_1:
Import ReentrancyGuardfrom openzeppelin and add the nonReentrantmodifier to placeBidfunction:
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.