BidBeasts_NFT_ERC721.sol::burn function allows any user to burn an NFT they are not the owner of creating a DoS attack and dismantling the marketplace contract logicNormal behaviour: Only the owners of NFTs should be allowed to burn them.
Problematic behaviour: Any user can call the BidBeasts_NFT_ERC721.sol::burn function and burn an NFT they are not an owner of.
Root cause:
Likelihood: High
The vulnerability occurs when
a malicious user calls the BidBeasts_NFT_ERC721.sol::burn function and burns an NFT belonging to any seller in the NFT marketplace.
Impact: High
This is a vulnerability with a high impact, as malicious users can attack the NFT marketplace by burning any or all of the listed NFTs. As a result, the marketplace will not be able to provide its intended services, thus resulting in a Denial of Service for any users or sellers.
As a PoC include the following test in the Foundry test suite and run with forge test --mt test_burnNFT_LetsNonOwnerBurnNFT.
The test shows how any user can burn an NFT they are not an owner of.
To mitigate the DoS attack vector the _checkAuthorized function from ERC721.sol should be used as a check prior to calling _burn. This will ensure that msg.sender can burn the NFT only if they are the current owner or an approved address.
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.