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

Unauthorized `setPassword` Function Access

Summary

The setPassword function should verify that it's the owner who is calling the function.

Vulnerability Details

The setPassword function lacks a check to confirm if msg.sender is equal to s_owner.

Impact

Any user can take control and alter the s_password variable.

Tools Used

Manual inspection.

Recommendations

Introduce the following check in the code:

if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
}
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.