In normal operation, when a user places a bid on an active auction, the contract checks if the new bid is higher than the current highest bid, refunds the previous highest bid to its bidder, and then updates the highest bid and bidder details.
The specific issue is that the refund to the previous bidder is executed before updating the state variables for the highest bid and bidder, allowing a malicious contract bidder to reenter the placeBid function during the refund call, potentially exploiting the old state to receive multiple refunds or manipulate the auction.
Likelihood:
A contract acts as a bidder and places a bid that becomes the highest.
A new bid is placed, triggering the refund to the contract bidder, which reenters via fallback.
Impact:
Attacker drains contract funds through repeated refunds before state update.
Auction integrity compromised, leading to unfair outcomes or halted auctions.
Implement a reentrancy guard using OpenZeppelin's ReentrancyGuard modifier on placeBid. Alternatively, follow Checks-Effects-Interactions pattern by updating state before sending ETH, or use a pull-payment system where bidders withdraw refunds separately.
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.