Function PasswordStore::setPassword does not check if the caller is the owner, so that an attacker can overwrite the password causing the loss of the owner's password.
The function above does not check the msg.sender so that everyone can call it. An attacker can therefore overwrite the owner's password. This is not the intended behaviour since in the documentation it's clearly written that ONLY the owner can set a new password.
The following code, if inserted in PasswordStore.t.sol, proves that an attacker can successfully overwrite the owner's password.
foundry
In function PasswordStore::setPassword revert if msg.sender is not the owner.
Also add the following test to PasswordStore.t.sol
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.