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

Password visible as blockchain data is public

Summary

Common misconception that data on the blockhain in private variable is private and not viewable by anyone else. Additionally some think since blockchain involves cryptography data is encrypted.

Vulnerability Details

The password once stored on the blockchain is no longer a secret as it is visible to anyone. It is very easy to look up what is stored in the seconds storage slot containing "string private s_password"e.g web3.js using

web3.eth.getStorageAt(contractAddress, storageSlotNumber == 1)

Impact

Password is leakable, leaked so PassWordStore contract is not safe, secure and working as expected

Tools Used

Manual Analysis

Recommendations

Consider storing encrypted password online and offline have a decrypting and encrypting software encrypt password before storing on blockchain and decrypt once retrieved from blockchain
However most important is that blockchain is not the best place to store passwords or private, confidential data even encrypted as the encrypted data gives information to hackers where to start to try figure out your password

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.