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

Missing access control

Summary

Missing access control is setPassword()

Vulnerability Details

According to dev comment * @notice This function allows only the owner to set a new password. but there is no access control modifier or require statement that current user is owner of the contract.

Impact

Anyone can hit setPassword() and set new password.

Tools Used

Manual code review

Recommendations

Use modifier or make require statement for checking that user must be owner

function setPassword(string memory newPassword) external {
+ require(msg.sender == s_owner, "not owner");
s_password = newPassword;
emit SetNetPassword();
}
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.