The password stored in the Password Store is stored on-chain and can be viewed by anyone that wants to see it.
The private storage variable PasswordStore::s_password
is used to hold the password stored in the Password Store. However, the value stored there can be obtained by anyone that wants to know it since all data stored on a public blockchain is freely available.
Additionally, anyone watching the mempool could see calls to the setPassword(string memory newPassword)
function and see the new password before it is even set.
Any password stored in the vault is no longer private and can be obtained by anyone - see the Foundry/Forge PoC below.
In reality a Web3 JS library (e.g. ethers.js) would be used to pull data out of a live Password Store contract.
The PoC consists of two tests (one for a short password stored in a single storage slot, one for a longer password that is stored over multiple slots), and a helper function to retrieve the password from storage.
Foundry/Forge
None - storing private data on-chain on a public blockchain is never recommended.
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.