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

setPassword function does not have an onlyOwner modifier, anyone can call this function

Summary

Anyone can call this function and change the password. It should be restricted to only the owner.

Vulnerability Details

Password can be changed multiple times by anyone, there is no limit and no res

Impact

malicious users can keep consistently changing the password, making it difficult to know what the password actually is/ disrupt other features from being accessed

Tools Used

Found the vulnerability doing a manual review.

Recommendations

+ modifier onlyOwner() {
+ if (msg.sender != s_owner) {
+ revert PasswordStore__NotOwner();
+ }
+ _;
+ }
- function setPassword(string memory newPassword) external {// rest of code}
+ function setPassword(string memory newPassword) external onlyOwner {// rest of code}
Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 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.