The BidBeasts::burn function should only allow the contract owner or the token owner to destroy a token, ensuring that only authorized parties can remove NFTs from circulation. In the current implementation, the burn function is declared as public without any access control, allowing any address to call it and burn any token, regardless of ownership.
Likelihood:
Any external user can call the burn function at any time.
There is no restriction based on token ownership or contract ownership.'
Any NFT in the contract can be destroyed by anyone, leading to permanent loss of user assets.
Users would lose trust in the contract and platform due to the risk of unauthorized token destruction.
paste the code below in the test suite BidBeastsMarketPlaceTest.t.sol
Restrict the burn function so only the contract owner or the token owner can call it. For contract owner only:
Or, to allow token owners to burn their own tokens:
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.