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

Lack of access control when setting new password

Summary

Password can be changed by anyone because of missing access control.

Vulnerability Details

The setPassword function must be callable by the owner only. However, it lacks access control, therefore it can be called by anyone.

Impact

The actual password can be lost and overwritten by a new one.

Tools Used

Manual Review

Recommendations

Add a form of access control:

function setPassword(string memory newPassword) external {
+ require(msg.sender == s_owner)
s_password = newPassword;
emit SetNetPassword();
}
Updates

Lead Judging Commences

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