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

Anyone can obtain the password value.

Summary

Anyone can see the stored password in the contract.

Vulnerability Details

Blockchain, by itsnature is public, anyone can see the variables sotred in it.The s_password state variable visibility is private, this means that can only be accessed by the contract itself but not significates that in the blockchain is not visible. An attacker can utilize a blockchain explorer to view the value of the password. This breacks completly the core functionallity of the contract.

Impact

Anyone can see the value of the password, causing the theft of it.

Tools Used

Manuel review.

Recommendations

A solution could be store the hash of the password for example using keccack256().

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 2 years ago
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.