Lack of isOwner check on PasswordStore::setPassword method enables anyone to override the password that was set by the owner.
Lack of isOwner check on PasswordStore::setPassword method enables anyone to override the password that was set by the owner thus, breaking the assumption that the contract owner can safely store and retrieve his password because the owner is not guaranteed to always retrieve the exact password he stored in the contract.
Include the below code excerpt in test/PasswordStore.t.sol
and run in the terminal
forge test --match-test test_non_owner_can_set_password
The assumption is, the contract owner can safely store and retrieve what he stored. That assumption is broken because anybody can override what the contract owner stored.
manual review
Only set the password if the msg.sender == 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.