The setNftValue()
function in the Trustee
contract allows associating a value with an NFT index. However, this function does not verify if a value already exists for the specified index. As a result, it is possible for the trustee to overwrite a previously defined value for an NFT, which might not be the expected behavior.
If the expected behavior was that NFT values should be immutable after their initial definition, then this functionality represents a vulnerability.
Financial exploitation: In the buyOutEstateNFT
function, beneficiaries can purchase NFTs at the value set by the nftValue
mapping. If a trustee can arbitrarily change these values after they're set, they could:
Decrease the value of an NFT just before a beneficiary executes buyOutEstateNFT
, causing other beneficiaries to receive less compensation
Manipulate values to favor certain beneficiaries over others
Significantly devalue assets that may represent substantial real-world value (e.g., real estate)
Trust violation: The contract is explicitly designed for inheritance management where values should represent real-world assets. The ability to arbitrarily change these values undermines the entire trust model of the contract.
Inconsistency with contract semantics: The createEstateNFT
function's intended behavior is to set a one-time value for an NFT representing real estate or other high-value assets. The ability to change this value later contradicts the function's purpose and documentation.
Collusion risk: A trustee could collude with one beneficiary to manipulate asset values in their favor, especially after the original owner becomes inactive.
The following code demonstrates how an existing NFT value can be overwritten:
Place the test in the test folder and run it with the following command
Based on the context of the InheritanceManager
contract and how the NFT values are used to determine financial compensation during the buyout process, values should be immutable after their initial definition. We recommend modifying the setNftValue()
function to check if a value already exists before allowing modification:
To illustrate the potential financial impact of this vulnerability, consider this scenario:
Three beneficiaries (A, B, C)
NFT represents real estate valued at 900 USDC
Beneficiary A wants to buy the NFT
With the original value (900 USDC):
Payment calculation: (900 / 3) * 2 = 600 USDC total
Each remaining beneficiary receives: 600 / 2 = 300 USDC
If a trustee maliciously reduces the value to 300 USDC before the purchase:
Payment calculation: (300 / 3) * 2 = 200 USDC total
Each remaining beneficiary receives: 200 / 2 = 100 USDC
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.