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

Unauthoraized users can change password

Summary

a security vulnerability that allows anyone to change the stored password without proper authorization. The contract doesn't check that only the owner can set the password.

Vulnerability Details

An attacker could potentially call the vulnerable "setPassword" function and change the stored password. Here is an example of how this could be exploited:
function exploitSetPassword(string memory newPassword) external {
vulnerableContract.setPassword(newPassword);
}

Impact

Could potentially lead to compromise of very sensitive data due to a password change

Tools Used

Remix IDE

Recommendations

add the " if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
}" also to the "setPassword" function.

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.