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

Passwords Stored On-Chain Visible By Anyone

Vulnerability Details

The password is stored directly on the blockchain in a private variable s_password. Even though the variable is marked as private, it is not hidden from blockchain observers. Anyone can inspect the contract's state and retrieve the hashed value of the password.

14 string private s_password;

Impact

High. While users cannot directly view the password from the contract's public interface, any attacker could retrieve the password from the blockchain data storage, easily accessible with tools like Foundry, Remix or evm.storage.

Recommendations

Avoid storing sensitive data, like passwords, directly on the blockchain. Consider using off-chain methods for storing such data or implementing encryption methods.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year 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.