The inherit() function in InheritanceManager allows any address to claim ownership under specific conditions, even if they are not the intended beneficiary. If the contract has been inactive for at least 90 days and there is only one beneficiary, the function assigns ownership to msg.sender without verifying whether they are the legitimate beneficiary.
impact: High
likelihood: Low
The relevant code snippet:
If there is only one beneficiary, msg.sender is assigned as the new owner without confirming that they are the actual beneficiary. This allows an attacker to exploit the function by calling inherit() themselves, effectively stealing control of the contract.
An attacker can illegitimately claim ownership of a wallet under the following conditions:
1. The original owner has not interacted with the contract for at least 90 days (block.timestamp < getDeadline() is false).
2. There is exactly one beneficiary in the beneficiaries list.
3. The attacker calls inherit() before the legitimate beneficiary does.
verify the msg.sender before set the new owner
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.