Interesting Mulberry Eagle
High
The createBid()
function in the contract updates the auction state (bidder, amount) after transferring ETH to the last bidder. This allows me to reenter the contract during the external call _safeTransferETHWithFallback(lastBidder, _auction.amount)
this before the state update, enabling me to repeatedly receive refunds.
No response
No response
No response
- Bob (the attacker) places a bid on an auction for a Noun.
- Bob waits for the auction to near expiration, preparing to place a higher bid.
- Bob places the new bid, triggering createBid, and the contract attempts to refund the last bidder, Alice.
- Before the auction state is fully updated (specifically the bidder and amount variables), Alice is refunded.
- Bob exploits this by calling createBid again, causing the contract to refund multiple times, draining ETH from the contract.
Bob can repeatedly drain ETH from the contract by exploiting the reentrancy vulnerability. Each time, he can receive Alice's last bid amount, and by triggering this multiple times, he can deplete the contract's funds. This results draining all the ETH from the contract.
No response
No response