Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

setPassword not protected

Summary

Any wallet can set a new password.

Vulnerability Details

The intention of this contract is to only allow the owner of Password store to be able to set the password. However, as the method setPassword does not require the sender to be the owner, any wallet can set a new password.

Impact

As soon as a malicious actor wants to overwrite passwords they can do it freely, so it makes this app unusable.

Tools Used

Recommendations

Add the same requirement added in the view function :

    if (msg.sender != s_owner) {
        revert PasswordStore__NotOwner();
    }
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 2 years ago
inallhonesty Lead Judge
about 2 years ago
inallhonesty Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-lacking-access-control

Anyone can call `setPassword` and set a new password contrary to the intended purpose.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.