The NFT auction system in NFTLiquidator
allows bidders to place bids, with the previous highest bidder receiving a refund when outbid. However, an attacker can exploit this refund mechanism by using a malicious contract (MaliciousBidder
) that intentionally rejects ETH refunds in its receive()
function.
When the attacker places a bid using MaliciousBidder
, they become the highest bidder.
When a legitimate bidder tries to outbid them, the contract attempts to refund the attacker.
However, since the attacker’s contract always rejects refunds, the transaction fails and blocks further bidding.
This creates a denial-of-service (DoS) attack, locking the auction in favor of the attacker.
The previous highest bidder is refunded immediately using transfer()
.
If the previous highest bidder is a malicious contract (e.g., MaliciousBidder
), it can reject the refund by reverting in its receive()
function.
Since the refund fails, the entire transaction reverts, and the new bid is blocked.
This means no one else can place a bid, effectively locking the auction in favor of the attacker.
PoC
maliciousBidder.sol
The Test:
The Output:
Auction Disruption: No one can place a new bid once an attacker locks the auction.
Unfair Advantage: The attacker can win the auction without competition at a low price.
Financial Loss: The NFT might be sold for much less than its true market value, harming sellers and liquidators.
Loss of Trust: Users may stop participating in auctions if they realize they can be griefed in this way.
To prevent this attack, modify the refund logic:
Use a Pull-Based Refund Mechanism:
Instead of sending ETH refunds automatically, store refunds and let users withdraw them manually via a withdrawRefunds()
function.
This ensures that failed refunds don’t block the auction process.
Set a Time Limit for Withdrawal:
If the previous highest bidder doesn’t withdraw their refund within a certain time, allow a fallback mechanism to move forward.
Blacklist Malicious Bidders:
If a user consistently blocks refunds, restrict them from participating in future auctions.
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.