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

Passwords are plain-text

Summary

Passwords are stored on-chain, and anyone knowing the ABI of the contract, can decode the password from transaction's call data.

Vulnerability Details

  1. Send tx to "setPassword(string)" method with any password, e.g. "secret"

  2. Get transaction data (e.g. cast tx *tx_hash*)

  3. Decode the calldata, e.g. using foundry

cast 4byte-decode 0x290bb453000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067365637265740000000000000000000000000000000000000000000000000000

will output:

1) setPassword(string)
secret

Impact

Password can be easily read and exploited.

Tools Used

  • foundry (cast)

Recommendations

Encrypt password off-chain, don't send plain-text.

Updates

Lead Judging Commences

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.