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

setPassword function lacks access control.

Summary

the setPassword function lacks access control, allowing anyone to set a new password.

Vulnerability Details

The setPassword function lacks proper access control,
permitting anyone to change the password. To enforce the intended behavior, it should be restricted to the owner by verifying that msg.sender matches the owner's address (s_owner).

Impact

Unauthorized users can change the password.

Tools Used

Manual Analysis

Recommendations

insert this line in the setPassword function

require(msg.sender == s_owner, "Only the owner can set the password");
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.