Consensys / Tokens

Ethereum Token Contracts
MIT License
2.06k stars 1.2k forks source link

Insecure Credential Storage #152

Open larrycameron80 opened 5 years ago

larrycameron80 commented 5 years ago

Insecure Credential Storage Vulnerable module: web3 Introduced through: truffle-hdwallet-provider@0.0.3 Detailed paths Introduced through: erc20-tokens@ConsenSys/Tokens#df959c7db75cc5fbb1591775353733958b3ceca1 › truffle-hdwallet-provider@0.0.3 › web3@0.18.4 Introduced through: erc20-tokens@ConsenSys/Tokens#df959c7db75cc5fbb1591775353733958b3ceca1 › truffle-hdwallet-provider@0.0.3 › web3-provider-engine@8.6.1 › web3@0.16.0 Overview web3 is a JavaScript API which connects to the Generic JSON RPC spec.

Affected versions of this package are vulnerable to Insecure Credential Storage. The current implementation of web3.js could result in wallet decryption under certain circumstances. When a wallet is saved and encrypted into local storage, a private key is needed to load the wallet. However, this private key is available via LocalStorage and is readable in plaintext on a webpage after a wallet is loaded.

This implementation could be abused by an attacker through client-side attacks such as Cross-site Scripting (XSS) and could result in theft of a user's wallet private key.