Anyone can execute the setPassword()
to set the new password due to the lack of access control.
The setPassword()
lacks proper access control, allowing anyone to invoke it to set the new password. Consequently, the contract owner's password will be overwritten.
https://github.com/Cyfrin/2023-10-PasswordStore/blob/856ed94bfcf1031bf9d13514cb21b591d88ed323/src/PasswordStore.sol#L26
The contract owner's password will be overwritten. Therefore, they will lose their password.
Manual Review
Apply the onlyOwner
modifier to the setPassword()
like the below snippet. Only the contract owner will be able to set the new 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.