Description:
The InheritanceManager::inherit
function allows any user to become the owner if there is exactly one registered beneficiary
. This is due to the lack of verification ensuring that msg.sender
is actually the designated beneficiary for recovery.
When the owner adds their second wallet as the sole beneficiary, an attacker can call InheritanceManager::inherit
after the inactivity period and take control of the contract.
Once the attacker becomes the owner, they can modify beneficiaries[]
and add their own address or multiple addresses under their control, ensuring that beneficiaries.length > 1
and blocking future owner and legitimate inheritance claims.
Impact:
This vulnerability leads to the total and irreversible loss of control over the contract and its assets. Once exploited, the rightful owner and beneficiaries are permanently locked out, losing access to their inheritance. The attacker gains full authority over the contract, allowing them to manipulate the list of beneficiaries, block future claims, and redirect all funds to wallets under their control. This effectively turns the inheritance mechanism into an attack vector, breaking the contract’s intended logic and resulting in catastrophic financial loss.
Manual review
Foundry for testing
Recommended Mitigation: Consider adding a check to ensure that msg.sender
is the address located at the index 0
of the beneficiaries[]
array, which should be the designated recovery wallet for the owner. This prevents unauthorized users from assuming ownership.
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.