The inherit()
function lets anyone become the contract's owner after a deadline, even if they aren't the intended beneficiary. This happens when there's only one beneficiary because the code forgets to check if the person calling the function is actually that beneficiary. This means someone could steal the contract and its funds.
The inherit()
function is designed to transfer ownership to the beneficiary after the deadline. However, when there is only one beneficiary, the function only checks if the deadline has passed and if beneficiaries.length
is equal to 1. It fails to verify that the caller (msg.sender
) is the beneficiary at index 0. This oversight allows any external user to call inherit()
after the deadline and become the owner, effectively stealing the contract and its funds.
This vulnerability allows any external user to claim ownership of the contract and its funds after the deadline, leading to potential loss of assets. This is a critical security flaw that directly contradicts the intended functionality of the contract.
Manual Review
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.