The setPassword function in PasswordStore contract allows a non-owner to change the password, which should not be allowed as per requirements.
The setPassword function does not check to see if the caller (msg.sender) is equal to the owner (PasswordStore:s_owner)
As a contract to be deployed to a public production blockchain, the likelihood of this vulnerability being exploited is high. Additionally, the impact upon being exploited would be high as control over managing the sensitive content (s_password) would be lost. Therefore, overall impact is high.
Two Javascript tests that highlight this problem can be found at the GitHub links below...
non-owner cannot set password
setPassword called by non-owner should not emit SetNetPassword event
Here is an image showing these two tests failing.
Visual Studio Code
Hardhat
A modifier, onlyOwner, should be created as shown below.
This modifier should be added to the setPassword function which will prevent a non-owner from being able to execute the function.
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.