The InheritanceManager contract's addBeneficiery() function does not validate the _beneficiary address, allowing the owner to add address(0) as a beneficiary. This can lead to funds being sent to address(0) during withdrawInheritedFunds(), effectively burning ETH or ERC20 tokens and causing a loss of funds for legitimate beneficiaries.
The function lacks validation to ensure that _beneficiary is not address(0). It also does not check for duplicates, but the primary concern here is the zero address.
When address(0) is added to the beneficiaries array, it is treated as a valid beneficiary. Later, when withdrawInheritedFunds() is called after inheritance, the function attempts to distribute funds equally among all beneficiaries, including address(0).
There is loss of funds by burning them to the 0 address.
Manual review.
Add input validation.
Proof of concept :
```solidity
```
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.