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

Function `setPassword` is not protected

Summary

Anyone can call the function setPassword

Vulnerability Details

This allowing to change the heat of s_password

Impact

Anyone can set the storage variable s_password with the function setPassword

Tools Used

Manual review

Recommendations

@@ -24,6 +24,9 @@ contract PasswordStore {
* @param newPassword The new password to set.
*/
function setPassword(string memory newPassword) external {
+ if (msg.sender != s_owner) {
+ revert PasswordStore__NotOwner();
+ }
s_password = newPassword;
emit SetNetPassword();
}
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.