Despite being marked as private, the s_password variable within the PasswordStore contract can be accessed outside of the contract. This vulnerability stems from the public nature of data on the blockchain, allowing individuals to read storage with knowledge of storage structure and direct access methods like low-level calls.
or
from web3.js
These methods bypass typical visibility constraints, illustrating that data on a blockchain is transparent and that 'private' does not mean 'secret'.
Exposing sensitive information in contract storage can lead to various security threats, including unauthorized access and potential loss of confidentiality. Users might believe their data is secure, but it is publicly accessible.
Ethereum nodes (for direct blockchain querying)
web3.js (for interaction scripts)
Foundry (knowledge of storage layout and inline assembly)
Never store plain sensitive information like passwords directly on the blockchain. Consider zero-knowledge proofs or off-chain storage solutions for such data.
If it's imperative to store sensitive data on-chain, encryption techniques should be used, though they also have limitations given the public nature of blockchain data.
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
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.