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

modifier onlyBeneficiaryWithIsInherited has a logic flaw

Summary

when msg.sender is not in beneficiaries or isInherited is false, modifier onlyBeneficiaryWithIsInherited shoud revert,but there is no revert.

Vulnerability Details

modifier onlyBeneficiaryWithIsInherited() {
uint256 i = 0;
while (i < beneficiaries.length + 1) {
if (msg.sender == beneficiaries[i] && isInherited) {
break;
}
i++;
}
_;
}

Impact

anyone can bypass the modifier

Tools Used

Recommendations

modifier onlyBeneficiaryWithIsInherited() {
uint256 i = 0;
while (i < beneficiaries.length + 1) {
if (msg.sender == beneficiaries[i] && isInherited) {
break;
}
i++;
}
revert("msg.sender is not in beneficiaries or isInherited is false") //
_;
}
Updates

Lead Judging Commences

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

Appeal created

tian2000 Submitter
6 months ago
0xtimefliez Lead Judge
6 months ago
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.