Hi,
I found out a potential bug in the contract 'Inheritancemanager.sol' in which there's flaw in inherit
function.
The key details of this potential vulnerability can be given as follows:
In this vulnerability, The inherit
function has a logical flaw when beneficiaries.length == 1
. In this case, it sets owner = msg.sender
without verifying that msg.sender
is the sole beneficiary. This allows any user to claim ownership of the contract after the inactivity period, even if they are not a beneficiary.
An attacker could steal ownership of the contract and its funds.
Manual Code Analysis + VS Code
Add a check to ensure msg.sender
is the sole beneficiary when beneficiaries.length == 1
. The sample code for beneficiary check is given below:
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.