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

setPassword()'s stored data can be read by anyone

Summary

The PasswordStore::setPassword() function stores data that can be read by anyone.

Vulnerability Details

The data (the owner's password) is stored in a non-encrypted manner. It makes it readable by anyone with, for example getStorageAt.

Impact

The password, which is supposed to be secret and known to the owner only, can be read, understood and used by anyone.

Tools Used

VS Code.

Recommendations

  1. Encrypt the password and store it on-chain.
    Though this option implies decrypting the password with off-chain computation.

  2. For a really secure solution, store the password off-chain.
    Though this option would nullify the contract's purpose.

Key take-away: basically, it is not safe to store sensitive data on-chain.

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.