The PasswordStore contract has a critical vulnerability related to missing access control. The contract does not properly verify that only the owner can set the password. This lack of access control allows any user to set a new password, compromising the security of the contract.
The setPassword function lacks an access control mechanism to verify whether the caller is the owner. As a result, any address can set a new password, regardless of ownership. Additionally, any user can easily overwrite a previously set password via backrunning.
Place the test case in the PasswordStoreTest.
The missing access control in the setPassword function unauthorized password changes.
Foundry
Use an access control modifier, such as onlyOwner, to ensure that only the owner of the contract can set 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.