The setPassword() function on line 26 does not have any Access Control set in code. This allows anyone (Attacker) (not just the s_owner (Victim)) to set the password.
Since setPassword() doesn't have any check/safeguard in place to make sure only the owner can call this function, Attacker will be able to call it and assign their own password.
Any person can call this function and set new password. If any Attacker changes the password, they could get (unauthorized) access to this password value (inside the PasswordStore Contract), which will be a security risk.
None
One way to make this function more secure, would be to use a require(), to check whether the person calling the function is the owner or not. Since we already have a variable that is storing the owner's address (s_owner), we can use this to make the code more secure. The code to implement this:
This way, now the Attacker wont be able to store their own password using this function by calling it.
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.