Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

[H-2]Clear Text Password Storage in PasswordStore

Summary

The PasswordStore contract is used to store a private password on-chain. Due to that, the password is exposed to anyone who reads the blockchain data.

Vulnerability Details

The setPassword function in the PasswordStore contract stores the password on the blockchain directly on the blockchain without any encryption or hashing. This meant that it is visible as a clear text and anyone could have access to it.

Proof of Concept:

  1. Deploy the contract using Account1 as the owner.

  2. Call the setPassword function and set a new password.

  3. Inspect the blockchain data and you should be able to read the saved password as clear text.

Impact

The impact is high and the likelihood is also high. The attackers could retrieve sensitive information as it is easily accessed due to the blockchain being public.

Tools Used

Manual Review

Recommendations

Sensitive data such as passwords are not recommended to be stored as clear text on the blockchain. Maybe consider using a hashing or off-chain encryption in order to protect the password.

Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-anyone-can-read-storage

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

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.