Normally, only the NFT owner or an authorized operator should be able to burn their NFT. However, in the current implementation of the BidBeasts contract, any address can call the burn() function on any token ID, regardless of ownership.
This allows a malicious user to permanently destroy NFTs owned by other users, leading to loss of assets and disruption of the project.
Likelihood:
The function is publicly accessible, so this will occur whenever any external address calls burn().
No ownership check is performed before calling _burn(), making the vulnerability always exploitable.
Impact:
Attackers can burn NFTs belonging to other users, resulting in permanent loss of valuable tokens.
This undermines user trust in the protocol and could make the NFT collection unusable.
Mint: OWNER mints an NFT to SELLER.
Attack: BIDDER_1 (unauthorized) calls burn(tokenId).
Verification: ownerOf(tokenId) Reverts because the NFT has been destroyed, proving anyone can burn others’ NFTs.
To mitigate this:
Use _isApprovedOrOwner Check:
Before performing _burn(tokenId), validate that the caller is either the owner of the token or an operator approved by the owner. OpenZeppelin’s ERC721 implementation provides _isApprovedOrOwner(msg.sender, tokenId) for this exact purpose.
Restrict Access in Public Functions:
Ensure that all sensitive actions (burning, transferring, or modifying token metadata) are restricted to authorized addresses only. This prevents arbitrary users from performing destructive operations.
In the BidBeasts ERC721 implementation, the burn function is publicly accessible, allowing any external user to burn NFTs they do not own. This exposes all tokens to unauthorized destruction and results in permanent asset loss.
In the BidBeasts ERC721 implementation, the burn function is publicly accessible, allowing any external user to burn NFTs they do not own. This exposes all tokens to unauthorized destruction and results in permanent asset loss.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.