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

Function is not restricted to owner

Summary

An important function is callable by anyone.

Vulnerability Details

The function setPassword() (line 26) can be called by anyone, allowing users to change the owner's stored password.

Impact

It disrupts the protocol functionality. The main use case for this contract, saving owner's private password, is no longer viable since everyone can change it.

Tools Used

No Tools.

Recommendations

Add logic to the function so that only the owner can call it, just like in the function getPassword() below.
Adding a modifier with this logic is a must, leaving the code more readable and avoiding repeating the same logic over and over again.

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.