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

Improper implementation of getPassword function

Summary:

getPassword() function is not properly implemented.

Vulnerability Details:

The function is supposed to return the password, but instead, it reverts with the PasswordStore__NotOwner error if the sender is not the owner.

Impact:

This means that the password cannot be retrieved by the owner either.

Tools Used:

Replit IDE, Foundry, Remix, PhindAI

Recommendations:

function getPassword() external view returns (string memory) {
require(msg.sender == s_owner, "This function can only be called by the owner");
return s_password;
}

The getPassword() function now returns the password if the sender is the owner. If the sender is not the owner, it returns the error statement.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.