The zero address in Ethereum is a publicly accessible address. Any funds sent to it, or to any contract controlled by it, cannot be recovered. The InheritanceManager.sol::addBeneficiary function does not validate whether the new beneficiary address is the zero address. This oversight can result in a loss of funds, defeating the purpose of allowing beneficiaries to inherit funds from the contract. Although the owner can remove a beneficiary, adding the zero address should be prevented for security reasons.
The following test demonstrates the issue and can be added to InheritanceManager.t.sol
Lost or Inaccessible to funds
Foundry test
Ensure that the new beneficiary address is validated before being added. The following implementation demonstrates this fix:
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.