The burnEstate()
function in the NFTFactory
contract allows the inheritanceManager
to burn any NFT without verifying that the caller is actually the owner of the token. The function only checks that the caller is the inheritanceManager
address but fails to validate ownership of the NFT being burned.
This violates a fundamental principle of ERC721 tokens where only the owner or an approved address should be able to transfer or destroy a token. Since the inheritanceManager
can mint and then transfer NFTs to beneficiaries, the ability to burn these tokens after transfer represents a serious vulnerability.
Unauthorized token destruction: The inheritanceManager
can burn any NFT at any time, even after legitimate ownership transfer to a beneficiary or other party.
Asset permanence violation: NFTs in this system are meant to represent real estate or other valuable assets as indicated by the createEstateNFT
function, which links them to real-world values. The ability to destroy these tokens undermines their value as a representation of ownership.
Trust violation: Beneficiaries and other token holders cannot trust that their NFT ownership is secure, which undermines the entire inheritance management system.
Potential financial loss: If an NFT represents a valuable real-world asset or has been purchased for a significant amount, its unauthorized destruction could result in substantial financial loss to the legitimate owner.
Only the inheritanceManager
contract can call this function (enforced by the onlyInheritanceManager
modifier).
If the system is designed with the assumption that the inheritanceManager
should have this level of control over all tokens, then this may be intentional behavior.
The following code demonstrates how the inheritanceManager
can burn an NFT that has been transferred to another owner:
Place the test in the test folder and run it with the following command
When running this test, we can observe that the token is successfully burned by the inheritance manager even though it is owned by user1:
To fix this vulnerability, the burnEstate
function should be modified to include ownership verification:
Alternatively, if the design intention is to allow the inheritance manager to burn tokens regardless of ownership (which would be unusual for an NFT system), this ability should be clearly documented as it poses significant trust concerns for token holders.
To illustrate the potential impact of this vulnerability, consider this scenario:
A beneficiary receives an NFT representing a valuable real estate property worth $500,000
The beneficiary has full ownership of this NFT according to the blockchain
At any time, the inheritance manager can unilaterally destroy this NFT
If the NFT is the only proof of ownership for the underlying asset, the beneficiary could lose their claim to the property
This vulnerability essentially means that any NFT in the system can be rendered worthless at the discretion of the inheritance manager, regardless of who rightfully owns it.
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.