The ownership transfer in the changeOwner function is executed in a single step, which poses a medium-level risk in the case of human error.
Ownership transfers are critical, and performing them in a single step increases the risk that (once proper access control is in place) the current trusted owner may mistakenly or accidentally assign ownership to an incorrect or invalid address. In case the ownership is accidentally transferred to an unintended address, it could potentially result in the contract becoming unrecoverable, putting the entire protocol at risk.
If the ownership is mistakenly transferred to an invalid or unintended address, it would lead to the permanent loss of control over the contract.
Manual review, Visual Studio Code (VSCode)
To mitigate this risk, the ownership transfer process should be modified to use a two-step process that requires confirmation from the new owner. This ensures that the address provided is valid and that the new owner consents to the transfer.
Recommended Two-Step Fix:
Introduce a proposedOwner variable to store the pending owner.
Require the new owner to explicitly accept ownership by calling a confirmOwner function.
This two-step process reduces the risk of mistakes by ensuring that the new owner has to explicitly confirm the ownership transfer.
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.