All data stored on-chain is readable. Despite the PasswordStore::s_password variable being defined as private, its value can still be read on-chain because it is stored without encryption. This means that all the passwords, even those intended to be private, are accessible. Anyone can read the stored password, potentially compromising the security of the system where the password is used.
Attacker: Anyone.
Victim: The owner of the system.
Go on https://sepolia.etherscan.io/ and enter a PasswordStore contract address (for example 0xF9d459e6BBA01ee4fF6a68aA9F0284aEdf0C8047)
Open a tx with Set Password method (for example: https://sepolia.etherscan.io/tx/0x8593641cb28d9b0b3bf7f704309a351e9d947bae19044330e23d14b1036842d4)
Access the Input data in the More Details section. Using the Decode Input Data button will show the stored password.
Manual review
To mitigate this vulnerability, it is recommended to encrypt the password before storing it on the chain. This will ensure that even if the data is read, the actual password will not be immediately visible.
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.