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

Anyone can read a private storage in Ethereum Smart Contract

Summary

Anyone can read a private storage variable in a Ethereum Solidity Smart Contract.

Vulnerability Details

Marking storage as private only makes it not be read by any other smart contract directly, but it can still be read by any person with enough knowledge to read a certain slot and certain type of variable (in this case string).

Impact

The stored value is a password, so it can be considered a high-impact vulnerability, considering what the password provides access to.

Tools Used

Manual Review is done to find this vulnerability.
Reference used: https://medium.com/@0xZorz/how-to-read-dynamic-strings-directly-from-storage-using-foundry-a4f43aa020fb

Recommendations

Storing sensitive data in ethereum is not advised. If there is a need to store data, some sense of strong encryption is recommended, where the final encrypted data should only be stored in the blockchain, and use a reveal mechanism off chain.

Updates

Lead Judging Commences

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