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

No access control for setPassword

Summary

The method setPassword can be called by any address instead of only the owner

Vulnerability Details

On line 23-24 of the smart contract, the comments state that only the owner of the contract is allowed to set a new password. However, the setPassword function has no restriction on who is able to call it. Any external address can call the function and change the password freely.

Impact

Contract is not working as intended and ownership is not correctly implemented

Tools Used

Manual Review

Recommendations

Before changing the state of s_password, there should be a check whether msg.sender == s_owner. Only if this is evaluated as true should the function be executed.

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.