If the safeTransferFrom
call inside the AuctionDemo::claimAuction
function reverts for any reason, all funds will be stuck within the contract, possibly forever
#1267
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
duplicate-739
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/hardhat/smart-contracts/AuctionDemo.sol#L112
Vulnerability details
Impact
All non-winning user bids won't be able to be refunded and the contract owner won't be able to receive the ETH from the winning bid
Proof of Concept
The
safeTransferFrom
call that is being made in theAuctionDemo::claimAuction
function, in order to send the auction winner their NFT, can revert, both intentionally and unintentionally. For example, it can revert if the receiver address does not implement theIERC721Receiver
interface, or it can also revert if theonERC721Received
function that is called withinsafeTransferFrom
reverts. If some of those scenarios take place, theclaimAuction
function will be DoSed, possibly forever, depending on the root cause of the revert.To help visualise the problem further, let's take a step-by-step example of how it can occur unintentionally:
claimAuction
function in order to claim the NFT that they just wonIERC721Receiver
interface, his transaction gets reverted. And it will keep on reverting no matter what the he does and how many times the function gets called. All of the auction funds are now stuck within the contract forever.Tools Used
Manual Review
Recommended Mitigation Steps
Extract the
safeTransferFrom
call into a separate function.Assessed type
DoS
The text was updated successfully, but these errors were encountered: