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

Inconsistent handling of verifying that only owner can retrieve password can lead to developer confusion

Summary

Inconsistent handling of verifying that only owner can retrieve password can lead to developer confusion

Vulnerability Details

Assuming prior recommendation to add onlyOwner modifier to setPassword function is taken, the getPassword function will be implementing the same check in a different manner. This could lead to developer and/or contract consumer confusion in maintaining or using the contract and result in unnecessary code changes which may or may not affect contract security.

Impact

Low

Tools Used

Visual Studio Code

Recommendations

Create, if needed, the onlyOwner modifier...

modifier onlyOwner() {
if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
}
_;
}

then, modify the getPassword function as shown...

function getPassword() external view onlyOwner returns (string memory) {
return s_password;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 2 years ago
inallhonesty Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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