Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Invalid

Inaccurate Beneficiary Index Retrieval in _getBeneficiaryIndex

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.

Test Example
function test__getBeneficiaryIndex__will_return_zero_if_address_is_not_a_delegate() public inheritanceSetUp {
assertEq(im._getBeneficiaryIndex(address(60)), 0);
}

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.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!