setPassword function is missing the ownership check, allowing anyone to modify stored password
setPassword is expected to be readable only by owner, according to @notice This function allows only the owner to set a new password. However, due to missing check (like in getPassword) it is publicly available, allowing anyone to mess up with the stored password.
High, Improper access control.
Real future impact depends on actual application of contract
Brains, mostly. Also, foundry.
Use same check as in getPassword in setPassword function:
Also, test case for this scenario:
move the check to modifier or internal function to avoid code duplication; otherwise developers may accidentally modify only part of checks in a future (e.g. when adding support of ERC2771 transactions)
Adopt some QA framework that is consistently pessimistic; currently, based on naming convention, looks like the tests are not aiming to support all cases of matrix scenario (owner/non-owner can read/write)
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.