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

Unchecked setPassword

Summary

The main purpose of this smart contract is crippled by a critical vulnerability in the main function of this smart contract.
Anyone can set the password inside of the 'setPassword' function.

Vulnerability Details

Inside of the 'setPassword' function there is no check to verify if the msg.sender is the actual owner of the smart contract.
Anyone is able to set a new password inside the smart contract.
This should not be the case as it renders the smart contract useless.

Impact

This is a high severity issue due to the nature of the bug.
It's fundamental to the functionality of the smart contract

Tools Used

Vs Code
Foundry

Recommendations

Implement a 'onlyOwner' modifier in the contract.
This is also a better way for the 'getPassword' function to validate that the msg.sender is the actual 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.

Dutch Submitter
almost 2 years ago

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.