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

Unencrypted password stored on-chain

Summary

The PasswordStore::s_password variable is a password stored on the blockchain, and can therefore be accessed by anyone.

Vulnerability Details

As soon as a password is set it will be accessible forever by anyone because the storage of smart contracts is public. Therefore, it can be read by the transaction details or by querying a node for the content of the slot that stores the variable.

Impact

The impact is high because the protocol does not work as it should. Nobody wants to store his password in a place where it can be read by anyone.

Tools Used

Foundry

Recommendations

Store passwords on the blockchain is not recommended. It depends on what your purpose is, but you may prefer to encrypt it off-chain, with a salt known only to you, and then store it on-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.