Summary:
The InheritanceManager::_getBeneficiaryIndex function returns zero when a beneficiary address is not found, which is problematic because index 0 is a valid position. This misbehavior may lead to unintended deletions.
Vulnerability Details:
When the beneficiaries array is not empty, a non-existent address will return index 0. This value is then used in InheritanceManager::removeBeneficiary, potentially deleting the wrong beneficiary.
Severity:
High – Incorrect beneficiary removal can lead to loss of funds or mismanagement of estate distributions.
Tools Used:
slither, aderyn, foundry
Recommendations:
Introduce a custom exception (e.g., InheritanceManager__Not_A_Beneficiary()) if the address is not found in the beneficiaries list.
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.