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

Ineffective Only Owner Check

Summary

The getPassword function has an unnecessary check to verify if the caller is the owner. Since the function is marked as view and can be accessed by any address without restriction.

Vulnerability Details

The getPassword function contains a check to verify if the caller is the owner. However, this check is unnecessary as the function is marked as view. In Ethereum, view functions do not modify the state and are inherently accessible to any address.

Impact

The

if (msg.sender != s_owner)

check does not provide any additional security in this context. It only adds unnecessary complexity to the code without offering any meaningful protection.

Tools Used

Manual Review

Recommendations

Remove the if (msg.sender != s_owner) check from the getPassword function.

Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other
nabeel Submitter
almost 2 years ago
inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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