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

The setPassword function can be modified by any user

Summary

The setPassword function does not obey the function specification and arbitrary user can update the password.

Vulnerability Details

In the description of setPassword function, there is a limitation that only the owner, s_owner, can set the password. However, the deficiency of authentication leads to critical issue that arbitrary user can modify the password. No corresponding modifiers or statement is provided.

Impact

Since the password can be updated by arbitrary user, the owner of the contract might retrieve distinct password as the he/she stores. It will be a critical issue if the protocol serves as authentication purposes, owner will get incorrect password and leads to unintended behavior.

Tools Used

Manual Review

Recommendations

Make use of openzeppelin Ownable template and initialize the owner at the constructor. Also, mark the setPassword with onlyOwner modifier. If not using oppezeppelin contract, developer should design their own onlyOwner modifier and validate the user when the function is triggered.

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.