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

Password overwites due to lack of owner check

Summary

The password in PasswordStore.sol is stored in a single variable, and does not take into account multiple users, leading to password overwrites.

Vulnerability Details

The function setPassword() can be called by anyone in order to overwrite the already set password variable s_password, due to the lack of access modifiers.

Impact

The password set by the user will be overwritten.

Tools Used

Manual Review

Recommendations

The line

require(msg.sender == s_owner)

could be added before the password write, either directly or as an access modifier.

Updates

Lead Judging Commences

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.