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

Nothing is private in blockchain

Summary

The restriction that only allow msg.sender to read password can be bypass using javascript

Vulnerability Details

Nothing is private in blockchain including slot in storage so using javascript like web3.eth.getStorageAt(contractAddress, slotNumber) we can read any data in storage.
In this case slotNumber is 1 as address private s_owner; is slot 0 and string allocate a new slot

Impact

Anyone can read the password of contract owner

Tools Used

VSCode

Recommendations

Don't do this kind of things , a blockchain is not a password vault ..

Updates

Lead Judging Commences

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.