The PasswordStore::setPassword(string memory newPassword)
method does not check for the owner, so any user can set a password.
The owner may lose his password he set using this contract because the PasswordStore::setPassword(string memory newPassword)
method does not check it is called by the owner. Any user can overwrite the password at any time. This way the owner will lose access to his password. Owner may lead to loss of access to the service for which the password was saved.
Loss of owner control over the password. Any user can set a password. Thus, when the owner wants to get a password to log into some service, he will not be able to do this, since another user has changed the password on the storage.
No specific tools.
It is necessary to add a check for the owner before setting a password. This can be done in several ways:
Add a revert, as done in the PasswordStore::getPassword()
method.
Create an onlyOwner
modifier and apply it to PasswordStore::setPassword(string memory newPassword)
and PasswordStore::getPassword()
to check msg.sender
is the owner's address.
Use Ownable from OpenZeppelin.
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.