Junglewise Threat Intelligence

MetaMask eth-ledger-bridge-keyring incorrect account signing

Severity: low · CVSS 3.1 · Published 2020-03-24

Vendors: npm.

Executive brief

MetaMask's eth-ledger-bridge-keyring library, used to connect Ledger hardware wallets for cryptocurrency signing, could sign transactions and messages with the wrong account in certain scenarios. When a user switched accounts or restored their application state, the library would default to signing with the first account rather than the user's currently selected account, potentially causing funds or assets to be signed with an unintended Ledger account.

Technical details

The vulnerability is an authentication/authorization defect (CWE-287) in the serialization/deserialization process of the keyring state. When the keyring state was persisted and then restored (e.g., after an application reset), the mapping of addresses to account indices was not properly restored. This caused the signing operation to always use account index 0 (the default account) rather than the account index specified by the user, unless that user happened to be on account 0. The vulnerability affects BIP44 accounts other than the first account, and requires the user to have previously added an account that was not re-added in the current session. The fix (merged in PR #14) adds a persistent mapping of addresses to indices that is restored during deserialization, ensuring the correct account is used for signing.

Affected products

  • MetaMask eth-ledger-bridge-keyring <0.2.1
  • MetaMask @metamask/eth-ledger-bridge-keyring <0.2.2

Timeline

  • 2020-03-04: disclosed: Advisory published by MetaMask
  • 2020-03-02: patched: Fix merged in PR #14; patched versions eth-ledger-bridge-keyring >=0.2.1 and @metamask/eth-ledger-bridge-keyring >=0.2.2

References