In a standard ERC721 token contract, the burn function is designed to allow only the token owner or an approved operator to destroy a token, ensuring that NFTs cannot be arbitrarily removed from circulation without permission, which protects user assets and maintains the integrity of ownership records.
However, in this implementation, the burn function is declared as public and directly invokes the internal _burn method from OpenZeppelin's ERC721 without performing any ownership or approval checks, enabling any external caller to burn any existing token ID, regardless of who owns it, which can lead to irreversible destruction of NFTs and potential disruptions in associated contracts like the marketplace.
Likelihood:
Tokens are minted and owned by users in the ecosystem at any point after deployment
Malicious actors scan for token IDs via events or queries and target them without restrictions
Impact:
Users suffer permanent loss of their NFTs, which may hold significant monetary or sentimental value
If burns occur on listed NFTs in the marketplace, it causes transfer failures during auction settlement, potentially locking bidder funds in the contract as transactions revert without proper cleanup
Add the following to the existing tests in BidBeastsMarketPlaceTest.t.sol
Add an ownership check before burning the token to ensure only authorized parties can perform the action. This aligns with standard practices in ERC721Burnable from OpenZeppelin.
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.