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

Private state variable s_password is accessible

Summary

Private state variables in Solidity such as s_password can be read by directly accessing the contract's storage

Vulnerability Details

Solidity's private keyword prevents other contracts from reading the state variable directly, it doesn't prevent on-chain or off-chain processes from viewing its content by querying the Ethereum storage

Impact

This is a high impact vulnerability, it exposes sensitive information

POC: https://github.com/david-dacruz/2023-10-PasswordStore/blob/607f03007e930ff2a06804a96cae0d624e7224cf/test/PasswordStore.js#L20C3-L45C6

Tools Used

Manual code inspection and hardhat with chai

Recommendations

Avoid storing plain-text sensitive data on-chain, consider encrypting data off-chain and only store its hash on-chain

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.