setPassword() function can be called by any address.
Let's review the code including its comments
So supposedly the function should be called by the owner only, but it never performs an ownership check. Anyone can change the password.
If someone detects this vulnerability they can change the password at any time, making this contract useless.
Manual Review + tests
For the test we should add the following code block in the PasswordStore.t.sol file:
After running the test it passes, meaning that anyone can change the password.
Modify setPassword() function so that it checks for ownership before changing the password:
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.