In the InheritanceManager
contract, there is a critical logic flaw in the inherit()
function that creates inconsistent behavior when there is only one beneficiary. When inherit()
is called with a single beneficiary, the function transfers ownership to the beneficiary but does not set the isInherited
flag to true.
This creates a paradoxical situation where the beneficiary has successfully inherited ownership of the contract but cannot access functions protected by the onlyBeneficiaryWithIsInherited
modifier. This is because this modifier requires the isInherited
flag to be true, which never happens in the single-beneficiary scenario:
Functional Inconsistency: A single beneficiary who has successfully claimed ownership through inherit()
has fewer privileges than multiple beneficiaries who have done the same, despite having greater ownership rights.
Critical Function Lockout: The sole beneficiary cannot access important contract functions such as buyOutEstateNFT()
and appointTrustee()
, which are protected by the onlyBeneficiaryWithIsInherited
modifier.
The following code demonstrates how a single beneficiary cannot access functions protected by the onlyBeneficiaryWithIsInherited
modifier after inheriting ownership:
Place the test in the test folder and run it with the following command:
There are two possible approaches to fix this vulnerability, depending on the intended contract behavior:
Set isInherited
to true in all valid inheritance scenarios:
Alternatively, modify the onlyBeneficiaryWithIsInherited
modifier to also allow the owner to execute the functions:
Consider this scenario:
A parent sets up an inheritance contract with their only child as the sole beneficiary
The parent becomes incapacitated, and after the 90-day inactivity period, the child calls inherit()
to claim ownership
The child wants to buy out an NFT representing a family property, which requires calling buyOutEstateNFT()
Despite being both the owner and sole beneficiary, the child cannot execute this function because isInherited
was never set to true
The assets represented by NFTs become permanently locked in the contract, despite the successful transfer of ownership
This scenario demonstrates how a single beneficiary faces a worse outcome than multiple beneficiaries would in the same situation, creating an unexpected and potentially devastating outcome for the intended inheritance plan.
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.