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

Password can be overwritten by anyone

Summary

The stored password can be overwritten by unauthorized users and will be lost forever.

Impact

There is no check if its the owner calling the setPassword() function. Anyone can therefor change the password.

Tools Used

Foundry

Recommendations

Check for owner in the setPassword() function

function setPassword(string memory newPassword) external {
if (msg.sender != s_owner)
{
revert PasswordStore__NotOwner();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 2 years ago
inallhonesty Lead Judge about 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.