Even if the variable s_password is private, but it can be viewed by anyone. Everyone can read data from the contract's storage slot.
If anyone gets the storage slot at which s_password data is stored, then they can easily get the password.
If the password fits in the 32 bytes slot, then it will be present at the slot 1 (in reference with the PasswordStore contract).
So, we can easily get it by:
But if the password can't fit in the 32 bytes slot, then the storage slot changes where password is stored, and slot 1 will only contain the length of string.
And if the password still can't be stored in secondSlot, then the next slot will be previous slot (i.e. secondSlot) + 1, and so on.
Bad impact on user's accounts, as anyone can use the password to authenticate to user's accounts.
Manual Review
To encrypt the password with user's public key, so that only the user can decrypt it with their private key.
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.