The function "PasswordStore::setPassword" does not check whether the password is being set by the owner or by someone else. There should be a check added to the function for identifying whether it is the owner who is trying to set the password.
Here the setPassword will be updated even if the function is called by anyone except the owner because there are no checks added to the function. This will lead to the loss of the password information stored by the owner.
This is the proof of my code - I used a test function "test_non_owner_can_set_password" for which the contract passed and proved the fact that anyone can set and overwrite the password stored.
This vulnerability will lead to the loss of the password information stored by the owner, which is the core functionality of the contract.
Foundry
We need to add a check in the function "PasswordStore::setPassword" to check whether the owner is calling the function to update the password or not.
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.