Malicious user can be the highest bidder at the end to make the auction unclaimable by rejecting to receive the NFT, which results in auction funds locked in the contract. #903
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
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/smart-contracts/AuctionDemo.sol#L112
Vulnerability details
Description
When an auction is ended, the winner or an admin can call
claimAuction
function to finalize the auction that includes sending funds back to non-winners and transfer the NFT to the auction winner.However,
NextGenCore
contract derives fromERC721
that supportsERC721Receiver
implementation.Abusing this feature/vulnerability, a malicious contract can be the highester bidder at the end and reject receiving the NFT. As a result, funds from all participants will be locked in the auction contract.
Proof of Concept
Here's a foundry testcase for proof:
Result of running the test:
Tools Used
Manual Review, Foundry
Recommended Mitigation Steps
Either only allow EOAs as participants or validate
ERC721Receiver
implementation.Assessed type
ERC721
The text was updated successfully, but these errors were encountered: