InheritanceManager.sol::onlyBeneficiaryWithIsInherited
modifier improperly checks the upper boundary of the beneficiaries array, potentially leading to an out-of-bounds array access. This vulnerability could result in unexpected contract behavior or runtime exceptions.onlyBeneficiaryWithIsInherited
modifier is intended to verify if the msg.sender is a beneficiary and if the isInherited flag is set to true. However, the while loop condition incorrectly checks:In Solidity, arrays are zero-indexed, meaning valid indices range from 0 to beneficiaries.length - 1. The current implementation extends the loop one step beyond the valid range, causing an out-of-bounds access when the index i reaches beneficiaries.length. This results in a runtime panic with error code 0x32 (array out-of-bounds access).
The output of this test:
Exploiting this vulnerability will cause the contract to revert with an out-of-bounds panic, preventing intended contract execution. This could block critical functionality for authorized beneficiaries, especially in inheritance-related scenarios.
Manual Review
Modify the loop boundary condition to correctly iterate within the valid range of the array:
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.