Given the public and immutable nature of the blockchain anyone with access to the blockchain can read the password. Don't even need to interact with the PasswordStore.sol contract.
Let's review the setPassword() function including comments:
If we check the @param newPassword it states it should be the new password to be set. However we can just check the Input Data from all transactions that call the setPassword() function in the PasswordStore contract.
Literally anyone can check the password, even for free. Even pay for a www.passwordleaks.com domain, fetch the input from all transactions related to setPassword() function calls in the PasswordStore.sol and show the password to anyone in the internet in a table:
| Contract Address | Owner | Password |
|---|---|---|
| 0x..t3st | 0x....3x4mpl3 | password |
Manual Review
Encrypt the password off-chain and just store the hash in the PasswordStore.sol contract, retrieve and de-crypt when needed. Otherwise using this contract is pointless.
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.