setFunction() is supposed to call by the owner only but it can be called by anyone.
setFunction() doesn't check the msg.sender. There is no access control to check the caller of the function is s_owner or not.
This vulnerability leads to change of the s_password of the owner. And the getPassword() is also useless here as there is no need to retrieve the s_password as the attacker himself changed the password. This defeats the sole purpose of the contract.
Manual review
Check that the msg.sender is s_owner or not.
Or else we can use OpenZeppelin Ownable access control functions.
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.