The documentation states that only the PasswordStore
contract's owner should be able to set the password stored in the contract. However, this fundamental requirement is not satisfied - anyone can set the password as the setPassword()
method lacks any protection.
The variable s_password
can be set using the setPassword
method, which is shown below.
There is no check if the caller is s_owner
, therefore anyone can successfully call this method and set the s_password
variable to any string.
Anyone can overwrite the currently saved password.
Manual review
Add the check if the msg.sender
is s_owner
in the setPassword()
method.
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.