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

Public Password Disclosure in PasswordStore.sol

Summary

The contract makes the wrong assumption that the data it contains will not be visible to the public. It is incorrect in the blockchain paradigm as all the contract's data, including its variables, is can be read publicly.

Vulnerability Details

After deployment, PasswordStore.sol gives the contract's owner the capability to set a password represented by the s_password variable. The private visibility only prevents other derived contracts from reading the content of a given variable. The information remains visible to the public.

For more information, please refer to:
https://docs.soliditylang.org/en/latest/contracts.html#visibility-and-getters

Impact

Disclosure of sensitive information (passwords, passphrases, etc.).

Tools Used

Foundry, VSCode, Remix

Recommendations

Reconsider the intended design of the application and whether blockchain technology is as an adequate choice.

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.