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

PasswordStore::setPassword() lags only owner check.

Summary

The function setPassword's NatSpec mentions that only owner should be allowed to change it, but it can be changed by anyone as it lags the only owner check.

Vulnerability Details

If there is no only owner check, then anyone can call the setPassword function and can change the password anytime.

Impact

Owner will get wrong password.

Tools Used

Manual Review

Recommendations

To add a only owner check.

function setPassword(string memory newPassword) external {
+ if (msg.sender != s_owner) {
+ revert PasswordStore__NotOwner();
+ }
s_password = newPassword;
emit SetNetPassword();
}
Updates

Lead Judging Commences

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.