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

Use of Unencrypted Password

Summary

Unencrypted Password storage

Vulnerability Details

Currently plain string is being used to store the password, which means it lacks for encryption. Anybody can access it easily from it's storage. Most explorer like etherscan, store the function params when called, any normal user can decode it.
Developers can check the storage layout and call the storage slot location of contract to get the value easily.
suppose contract is deployed on mainnet and contract address is 0x123, then password value can accessed easily by using this command in foundry.

cast storage --rpc-url $MAINNET 0x123 1

Impact

The lack of encryption puts the stored password at risk of exposure. Which can cause potential harm to protocol if password is being used in dependent or other protocol.

Tools Used

Manual Review & Foundry

Recommendations

encrypt the password off-chain and store the output hash on chain.

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.