A not-owner user can change the password. The PasswordStore::setPassword function should only be usable by the owner of the smart contract.
The PasswordStore::setPassword function does not check whether the user who is calling the function is the owner of the contract or not. This means that any user who calls the function can change the password.
Through this test you can verify that a not-owner user is able to change the password.
The impact is high because the function was designed to be used only by the owner, therefore this vulnerability causes a high damage to the smart contract because the operation is not as desired.
manual review
foundry
To avoid this vulnerability you need to create a modifier that is called on the function PasswordStore::setPassword. This modifier verifies that the user who is calling the function, via the value of msg.sender, is equal to the value saved inside s_owner.
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.