The winner can DoS the auction and stuck the NFT and users funds in the contract #63
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
edited-by-warden
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L104-L120
Vulnerability details
Impact
Winners will be able to DoS auctions and lock both their NFTs and all of the funds of other bidders. This issue arises because AuctionDemo's claimAuction uses push instead of a pull.
The winner does not need to be a user, it can also be a competitive entity. A competitor against the collection or against NextGen.
Proof of Concept
Once the auction has ended, the winner can invoke claimAuction. And to revert on his
_checkOnERC721Received
.The core issue is in this if if, within this
for
loop, where, if the current bidder is not the winner, their funds are refunded.Example:
Attacker loses some ETH, however 50 bidders lose their bids (the last one is the same as the attaker) and the NFT will remain stuck in the contract.
Tools Used
Manual review
Recommended Mitigation Steps
Utilize the pull method instead of the push method. This can be achieved by creating another function that allows users to manually withdraw their funds after the auction concludes.
Assessed type
DoS
The text was updated successfully, but these errors were encountered: