The setPassword(string memory newPassword) function is external, which means everyone can call this function.
There is no protection to allow only the owner to update the password.
So, someone could create a smart contract that will call this function and update the password to an arbitrary value.
the owner could loose his password
Use OpenZeppelin's Ownable contract, or add require(msg.sender != s_owner) to the code:
solidity
Copy code
function setPassword(string memory newPassword) external {
require(msg.sender != s_owner);
s_password = newPassword;
emit SetNetPassword();
}
Anyone can call `setPassword` and set a new password contrary to the intended purpose.
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.