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

Anyone can set a new password due to lack of access control

Summary

The setPassword function in the PasswordStore contract is intended for the owner's exclusive use. However, it lacks the necessary restrictions, allowing any user to change the password.

Vulnerability Details

The contract does not enforce owner-only access to the setPassword function. As a result, any Ethereum address can call this function and change the stored password. This oversight leads to a significant security risk of unauthorized password modification.

Impact

The whole logic of the contract is at risk, as the stored data is unreliable: it will return whatever last password that was set, regardless of whether it was done by the owner or not.

Tools Used

Manual analysis.

Recommendations

Add a modifier or a require statement to the setPassword function to check if the caller's address matches the owner's address, ensuring that only the owner can change the password.

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.