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

password store unencrypted in a private variable

Summary

The password is stored in s_password which is publicly stored in spite of the "private" keyword

Vulnerability Details

The password is stored in s_password which is publicly stored in the contract at the second storage
slot (index 1).

Impact

Anyone can access it

Tools Used

foundry cast:
cast storage <CONTRACT_ADRRESS> 1

Recommendations

• Do not put sensitive data on blockchain.
• If it is really needed, at least encrypt it with a secure algorithm and a key only you know.
• In case of password before encryption, hash it to do compararison
• Use a privacy librairy like zama fhEVM

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.