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

Private state variables can be read by anyone

Summary

Declaring a state variable as private does not mean it cannot be read.

Vulnerability Details

s_password should be only accessible by the s_owner, but can be accessed by anyone by calculating the appropriate storage slot where it is stored.

14: string private s_password;

The password can then be retrieved easily by a tool like chisel.

Tools Used

Manual Review

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-anyone-can-read-storage

Private functions and state variables are only visible for the contract they are defined in and not in derived contracts. In this case private doesn't mean secret/confidential

Support

FAQs

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