An attacker can change the password
Because there is no check for who is the caller, an attacker can easily change the password, even though only the owner should be able to.
In test file PasswordStore.t.sol
add this line before the setUp()
function.
Lastly add the following test at the end of the test file and run it via forge t --mt test_AttackerCanChangePassword -vv
An attacker can change the password, even though only the owner should be able to do it. This will cause the owner to lose his account, or other plethora of different issues.
Foundry
Make sure the caller is the owner of the contract, if not revert.
Example:
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.