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

Allows anyone to change the password

Summary

setPassword method allows any user to change the s_password.

Vulnerability Details

Since setPassword method is external and requires no validation checks, any user can change the s_password set by the s_owner.

function setPassword(string memory newPassword) external {
s_password = newPassword;
emit SetNetPassword();
}

Impact

Any malicious user can change the password and deny the actual owner to retrieve their original password.

Tools Used

Manual Review

Recommendations

Add a validation check that if msg.sender is s_owner only then password can be updated.

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.