Access control is needed in the setPassword function. Otherwise, anyone can change the password.
If there is no access control in the setPassword function anyone can set the password to anything they want and then use the password to access protected data or access parts of the code where the password is required.
A check should be added so that only owner can update the password, just like how it is done in getPassword function.
Anyone can set the password.
Foundry
Manual audit
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.