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

Anyone can view passwords by decode storage slot

Summary

Anyone can view passwords by decode storage slot

Vulnerability Details

This private variable only limits the access from external contract
But anyone can read the blockchain storage at that variable's slot
and decode to get the password value

string private s_password;

Impact

Make password disclosure for anyone

POC
cast storage [options] address slot
The string password variable is in slot 1

cast storage 0x5FbDB2315678afecb367f032d93F642f64180aa3 1

Tools Used

foundry cast

Recommendations

Don't store sensitive information on the blockchain.

Updates

Lead Judging Commences

inallhonesty Lead Judge almost 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.