The setPassword function does not have an ownership check, allowing anyone to modify the password
This means that an external actor can change the password without the owner's consent
This is a high impact vulnerability.
Malicious users can overwrite the password, leading to a potential loss of password when the owner calls the getPassword method it would return the changed password
POC: https://github.com/david-dacruz/2023-10-PasswordStore/blob/607f03007e930ff2a06804a96cae0d624e7224cf/test/PasswordStore.js#L47
Manual code inspection and POC with hardhat and chai
Implement an ownership modifier check mechanism
This can be done using by importing the Ownable contract by openzeppelin and using the onlyOwner modifier or with manual implementation
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.