In the placeBid
function, state variables are updated after external calls, which creates a reentrancy vulnerability. This could allow an attacker to re-enter the function multiple times before the state updates, leading to potential fund loss.
Affected Code:
The function transfers ETH to the previous highest bidder (payable(data.highestBidder).transfer(data.highestBid)
) before updating the bid state.
An attacker could repeatedly call the function, forcing multiple refunds and draining the contract’s funds.
Manual review
Update the sate variable before making an external call or add nonReentrant modifier to prevent reentrancy attacks.
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.