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

onlyOwner modifier should be considered for setPassword

Summary

Since the function setPassword states that only the owner has to be able to set a password, it would be sufficient to add onlyOwner modifier to it.

Vulnerability Details

As stated in the documentation, password should be set by owner only, so this vulnerability makes it possible to anyone to set it.

Impact

Password might be set by any user.

Tools Used

Manual codebase analysis.

Recommendations

- function setPassword(string memory newPassword) external {
+ modifier onlyOwner() {
+ require(msg.sender == owner, "Not owner");
+ _;
+ }
+ function setPassword(string memory newPassword) onlyOwner external {
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.

damoklov Submitter
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.