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

Incorrect Loop Condition in Beneficiary Modifier Leads to Out-of-Bounds Access

Summary

The onlyBeneficiaryWithIsInherited modifier in InheritanceManager.sol uses an incorrect loop condition, causing potential out-of-bounds array access and reverting legitimate beneficiary calls.

Vulnerability Details

The modifier iterates with i < beneficiaries.length + 1, allowing i to reach beneficiaries.length. Accessing beneficiaries[i] at this index exceeds the array bounds, triggering a runtime error. This occurs even for valid beneficiaries, blocking critical functions like buyOutEstateNFT and appointTrustee.

Impact

Beneficiaries cannot execute key functions, breaking core inheritance logic. Malicious actors could exploit this to block inheritance claims.

Tools Used

Manual code review.

Recommendations

Fix the loop condition to i < beneficiaries.length. Replace the while loop with an explicit check using a mapping or require(beneficiaries.includes(msg.sender)).

Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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