The InheritanceManager::inherit
function lacks access control, allowing an attacker to take over ownership under specific conditions. If the owner has only one beneficiary and inheritance deadline is passed, the attacker can trigger InheritanceManager::inherit
and claim ownership. Once they become the new owner, they can exploit functions restricted to the contract owner, such as InheritanceManager::sendERC20
, to steal funds.
The contract has only one beneficiary.
The attacker waits for the inheritance deadline to pass.
The attacker calls inheritanceManager::inherit()
, becoming the new owner.
As the new owner, the attacker calls inheritanceManager::sendERC20
to drain ERC20 tokens.
Paste the following test in inheritanceManagerTest.t.sol
Allows unauthorized takeover of the contract.
Drains contract balance by exploiting inheritanceManager::sendERC20
and inheritanceManager::sendETH
.
Foundry
Introduce access control such as adding the onlyBeneficiaryWithIsInherited
Modifier on the inheritanceManager::inherit
function as this ensures only valid beneficiaries can call inheritanceManager::inherit
, and also if beneficiaries are not trusted, then remove the below IF statement.
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.