-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AuctionDemo#claimAuction
is permanently DoSed if highest bidder is a contract that does not implement onERC721Received
#1759
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
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
141345 marked the issue as duplicate of #486 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as primary issue |
This was referenced Dec 1, 2023
Closed
This was referenced Dec 1, 2023
Auction winner can refuse to receive collection token results in other users' funds being stuck
#642
Closed
Closed
Closed
alex-ppg marked issue #739 as primary and marked this issue as a duplicate of 739 |
alex-ppg marked the issue as satisfactory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
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
If the winner of an auction is a smart contract that does not implement
onERC721Received
, or if it is implemented but leads to a revert (which could be done unintentionally or maliciously) then the NFT, as well as the funds of all active bids will be trapped in the contract indefinitely.Proof of Concept
AuctionDemo#claimAuction
uses ERC721'ssafeTransferFrom
to transfer the auctioned NFT from the current owner to the winning bidder. This function checks whether the receiver is a smart contract and if it is, attempts to callonERC721Received
.This scenario would lead to a complete DoS of
claimAuction
. Since it is the only function that is capable of sending the NFT and the ETH of the bidders from the contract, those funds would all be trapped in the contract.safeTransferFrom
callhighestBidder
with a different address that is capable of receiving the NFTcancelBid
orcancelAllBids
to retrieve their ETH because they revert if the auction is completedRecommended Mitigation Steps
Use
transfer
instead ofsafeTransfer
. Although an auction winner that does not implementonERC721Received
may not be able to access their NFT, they wouldn't have been able to receive it anyway ifsafeTransfer
was used, and this way losing bidders still get their ETH back.Assessed type
ERC721
The text was updated successfully, but these errors were encountered: