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

No control on setPassword function

Summary

No control over the contract, anyone can change the password

Vulnerability Details

this error was found on line 26. The function was to place control over the contract so only the owner can set a new password but the function had to restriction or access control so anyone can call the function.

Impact

the function has no restriction or access contract, therefore anyone can acesss the function and change the password.

Tools Used

Foundry

Recommendations

We can use require to place restrictions on anyone who isnt the owner from being able to set a new password.
with this we place acesss over the function to the owner only.
require(msg.sender == s_owner, "You are not the owner");

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.