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

Anyone can read password from the contract

Summary

Anyone can read the password from the contract via low-level storage read.

Vulnerability Details

Even though it was marked with private and other smart contract address can't read via getter function, this can be circumvent offchain with simulated contract read that has owner as tx.origin or using low-level contract read.

as example, here is the code used with ethers.js v5

await provider.getStorageAt(, 1)

The storage slot is 1 because password is a second storage variable declared in the code.

Impact

High

Tools Used

ethers.js

Recommendations

Don't store sensitive data 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.