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

No Access control: anyone can set the owner password

Summary

The function setPassword does not have any access control. This means that anyone can set the owner password.

Vulnerability Details

No modifier such as onlyOwner is present. A call to setPassword with any password from any address will result in updating the s_password contract storage variable accordingly.

Impact

The owner password can be modified by someone else.

Tools Used

Recommendations

Make PasswordStore inherit OpenZeppelin's "Ownable.sol" and add the onlyOwner modifier to setPassword.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year 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.