Auction winner can refuse the NFT and all other bidders won't receive their refund #937
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-739
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L112
Vulnerability details
Impact
During
claimAuction
we iterate through all bidders that participated in the auction:If the winner is a contract he can chose to revert on ERC721 fallback thereby denying other bidders a refund, leaving all tokens stuck in the auction contract.
Proof of Concept
This is one of the rare cases where not checking return values on calls is actually a good thing
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L115C1-L117C97
otherwise this attack would be much cheaper, just bid a small amount of ETH with a contract that doesn't have a receive or fallback function. However, this won't protect us from a malicious winner, of course he will also lose his tokens, but if the sum of all participants bids exceeds the winner's sum, the impact will be quite severe.
Tools Used
Forge, forge-std lib
Recommended Mitigation Steps
Allow bidders who didn't win the auction to refund their tokens separately
Assessed type
DoS
The text was updated successfully, but these errors were encountered: