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

Anyone can become owner to after deadline is passed with only 1 benefitancy.

Summary

Anyone can become a new owner if the manager only has 1 benefitancy and deadline has passed.

Vulnerability Details

The contract does not check if msg.sender is in the benefitancies so anyone could become a new owner after deadline is passed.

Impact

High, anyone can steal all assets in the InheritanceManager

Tools Used

Foundry

Recommendations

Change the following line

--if (beneficiaries.length == 1) {
++if (beneficiaries.length == 1 && msg.sender == benficiaries[0]) {

With the test to check for frontrun

function test_frontrunOwner() public {
vm.warp(1);
vm.prank(owner);
im.addBeneficiery(user1);
address evil = makeAddr("evil");
vm.warp(1 + 90 days);
vm.prank(evil);
vm.expectRevert();
im.inherit();
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Inherit depends on msg.sender so anyone can claim the contract

Support

FAQs

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