setPassword function does not check if msg.sender is s_owner, meaning that anyone can change the password by calling this function
Lack of checks mean attacker can change password previously saved by the owner as the test below illustrates. This test should have failed in a properly implemented contract, but with the current state of the contract, it passed.
The contract is not a reliable tool to save private password as it could be changed by attacker, and getPassword will then return a different password than originally saved by the owner
Foundry
Add the check that msg.sender is s_owner, the setPassword function should be modified as follow:
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.