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

Missing Access Control in `InheritanceManager::withdrawInheritedFunds` Allows Non-Beneficiaries to Trigger Payouts

Summary

The InheritanceManager::withdrawInheritedFunds function does not enforce a check to ensure the caller is a beneficiary. In the provided PoC, user4 (not a beneficiary) successfully triggers withdrawals after the inheritance period.

Vulnerability Details

The InheritanceManager::withdrawInheritedFunds function lacks proper access control, enabling any address (including non-beneficiaries) to trigger fund withdrawals. While beneficiaries ultimately receive funds, this violates intended authorization logic and exposes the contract to unnecessary external interference.

Impact

Low Severity

Theres no steal of funds but non-beneficiaries can forcibly initiate withdrawals, potentially disrupting planned fund distribution schedules.

Tools Used

Manual code review
Foundry test case (provided)

POC

User4, that is not a Beneficiery can call the withdrawInheritedFunds function

function test_withdrawFunds() public {
address owner = makeAddr("owner");
address user1 = makeAddr("user1");
address user2 = makeAddr("user2");
address user3 = makeAddr("user3");
address user4 = makeAddr("user4");
vm.startPrank(owner);
im.addBeneficiery(user1);
im.addBeneficiery(user2);
im.addBeneficiery(user3);
vm.stopPrank();
vm.warp(1);
vm.deal(address(im), 9e18);
vm.warp(1 + 91 days);
// user4 is not a beneficiaries
vm.startPrank(user4);
im.inherit();
im.withdrawInheritedFunds(address(0));
vm.stopPrank();
assertEq(9e18, user1.balance);
assertEq(9e18, user2.balance);
assertEq(9e18, user3.balance);
}

Recommendations

Ensure that InheritanceManager::onlyBeneficiaryWithIsInherited is working as intented

Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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

Give us feedback!