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

Anyone can change password

Summary

Anyone can set a new password.

Vulnerability Details

setPassword function allows anyone to set a password.

Impact

Anyone can change the password, so there is no point of having an owner for the contract. Owner does not have control over the password.

Tools Used

Manual

Recommendations

Add a modifier onlyOwner that checks if the msg.sender is equal to s_owner. An alternative solution would be having an if statement that checks if the msg.sender is equal to s_owner in the setPassword function, if not revert with error PasswordStore__NotOwner.

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.