The onlyBeneficiaryWithIsInherited modifier fails to properly enforce the "only inherited-state beneficiaries" restriction, allowing unauthorized access to critical functions even after fixing the array out-of-bounds issue.
Missing Explicit Validation:
The modifier uses a loop to check if msg.sender is a beneficiary but does not explicitly validate the result after the loop. Even if msg.sender is not a beneficiary, execution continues, permitting unauthorized calls.
Example: A non-beneficiary address bypasses the check because the loop completes without reverting.
Ignored isInherited State:
The modifier does not verify the isInherited flag outside the loop. Even if isInherited is false, calls from beneficiaries are allowed.
Unhandled Empty Beneficiaries:
If beneficiaries.length == 0, the loop is skipped entirely, granting unrestricted access to any caller.
Unauthorized users can invoke protected functions (e.g., buyOutEstateNFT, appointTrustee), leading to:
Theft of NFT-backed assets.
Malicious trustee appointments.
Disruption of inheritance processes.
Manual code review
Slither static analysis (to detect missing access controls)
Add Explicit Checks:
Optimize with Mappings:
Replace the beneficiaries array with a mapping for O(1) lookups:
State Consistency:
Ensure isInherited is validated independently of the loop logic.
This merged issue captures the critical flaws in the modifier’s access control mechanism, prioritizing fixes to prevent unauthorized access and inheritance system compromise.
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.