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

Out-of-Bounds Access in onlyBeneficiaryWithIsInherited Modifier

Description : The onlyBeneficiaryWithIsInherited modifier has an off-by-one error in its loop condition (i < beneficiaries.length + 1), which can lead to an out-of-bounds array access.

Impact: This may allow unauthorized addresses to bypass the check and execute the function, leading to potential vulnerabilities.

Recommended mitigation : Fix the loop condition to i < beneficiaries.length to prevent out-of-bounds access. modifier onlyBeneficiaryWithIsInherited() { uint256 i = 0; while (i < beneficiaries.length) { if (msg.sender == beneficiaries[i] && isInherited) { break; } i++; } _; }

Updates

Lead Judging Commences

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

Support

FAQs

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