InheritanceManager:inherit
and become the owner of the contractDescription: If there is only 1 beneficiary and the deadline has passed, anyone can call InheritanceManager:inherit
and become the owner of the contract, essentially stealing all funds.
There is no restriction on who can call the inherit
function and because of the line owner = msg.sender
, whoever calls the function becomes the contract owner.
Impact: Any address can become the contract owner and control all funds within the contract.
Proof of Code:
Add this test to InheritanceManagerTest.t.sol
Recommended Mitigation: Change the line in the inherit
function from setting the owner to the msg.sender to the first(and only) entry in the beneficiaries
array.
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.