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

Failure to implement access control on required funcions

The developer of the contract failed to restrict access to the functions getPassword(LN26) and setPassword(LN35), allowing those functions to be called by anyone.
If the password is used a requirement to access resources from the protocol, those recourses would be available to anyone who calls the getPassword function.
If the password is also used as a requirement to change the protocols settings, or to change the protocols state, someone with malicious intent could change the password and hence, set the protocol to a state where it fails to function as it should.

Mitigation Advice:
set A modifier called only owner that checks if the msg.sender == owner, and reverts if not.
This modifier should be applied to the setPassword and getPassword functions.

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.