The changeOwner
function lacks an access control mechanism, allowing any user to call the function and update the contract's owner. This issue creates a significant security risk, as unauthorized users can seize control of the contract, leading to potential misuse or exploitation of critical functions restricted to the owner.
Since there is no restriction on who can call the changeOwner
function, anyone can transfer the ownership of the contract. This could lead to severe consequences, such as:
Unauthorized users gaining full control over the contract.
Malicious actors taking ownership and altering contract behavior, draining rewards/funds, or locking out legitimate users.
Assume a contract deployed with address A as the initial owner.
Any external user, say address B, can call the changeOwner function.
address B executes changeOwner(B), successfully transferring ownership to themselves, despite not being the original owner.
Manual review
Use an access control modifier to ensure that only the current owner can update/change the owner.
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.