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

Any address is allowed to alter the password

Summary

Missing owner check in setPassword Function

Vulnerability Details

A malicious user can alter the s_password variable thus compromising the integrity of the contract

Tools Used

Manual Review

Recommendations

Use OpenZeppellin's Ownable contract and make the setPassword Function exist with the onlyOwner modifier.
OR
add the following line of code : if(msg.sender != s_owner) revert PasswordStore__NotOwner(); before the line of code that changes the password to ensure only the contract's deployer can alter the password

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.