The inherit()
function in the InheritanceManager
contract allows any address to claim ownership after the inactivity period of 90 days, even if they are not a beneficiary. This occurs when there is only one beneficiary in the contract. The function lacks proper access control mechanisms, such as a modifier to ensure only beneficiaries can call this function.
This vulnerability biases the purpose of the inheritance manager, as it allows arbitrary addresses to take control of the contract and its assets.
Contract Ownership Takeover: An attacker can monitor the inheritance contracts with only one beneficiary and claim ownership after the 90 days inactivity period ends. He can then control it and manipulate the beneficiaries set on the contract.
Contract Assets Withdrawal: The attacker becoming new owner of the contract can then perform call to function set with the onlyOwner
modifier. For example, the attacker could call both sendERC20()
and sendETH()
methods to drain all assets from the contract.
The following code demonstrates that the inherit()
function is vulnerable:
Place the test in the test folder and run it with the following command
The PoC confirms that the lack of access control on the inherit()
function allows attackers to manipulate the contract. The output will appear as following:
The inherit()
function should ensure that only beneficiaries can call this function and that the ownership cannot be taken over by an attacker.
Consider a scenario where an attacker exploits this vulnerability:
An estate worth 100 ETH is managed through this contract
The owner passes away, leaving a single beneficiary (for example his child)
After 90 days, the child attempts to claim ownership
A malicious actor who has been monitoring the blockchain front-runs the transaction and becomes the owner as described in our Proof-Of-Concept
The attacker withdraws the 100 ETH from the contract to his wallet
The contract is now empty, and the benficiary is not able to claim his due anymore
This scenario highlights the lack of protection of the contract on its fundamental purpose about secure inheritance.
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.