Skip to content

feat(keyring-eth-qr): validate Ethereum derivation paths - #715

Open
Qkin-Keystone wants to merge 2 commits into
MetaMask:mainfrom
KeystoneHQ:feat/ethereum-derivation-path-validation
Open

Qkin-Keystone wants to merge 2 commits into
MetaMask:mainfrom
KeystoneHQ:feat/ethereum-derivation-path-validation

Conversation

@Qkin-Keystone

Copy link
Copy Markdown

Description

QR hardware wallets currently accept Ethereum CryptoHDKey and CryptoAccount data without validating its derivation path. This can allow unsupported account data to be imported into MetaMask.

This PR updates @keystonehq/bc-ur-registry-eth from ^0.19.1 to ^0.23.2.

The updated package validates decoded Ethereum account data before the QR Keyring imports it:

  • Public key paths must start with m/44'/60'.
  • Private key data is rejected.
  • Invalid account data returns a user-friendly error instructing the user to select MetaMask as the wallet type and scan a new QR code.

No QR Keyring application code is changed; the validation is provided by the updated registry package.

Testing

  • Ran the @metamask/eth-qr-keyring test suite.
  • Ran the Accounts lint, formatting, dependency, and lockfile checks.
  • Built the QR Keyring package successfully.

Examples

Tested locally with MetaMask Extension by linking the updated @metamask/eth-qr-keyring package:

  • A valid m/44'/60'/... QR code proceeds to account selection.
  • An invalid m/44'/0'/... QR code is rejected before account selection.
  • MetaMask displays:

QR code error. Return to your hardware wallet, select MetaMask as the wallet type, then generate and scan a new QR code.

Note

@keystonehq/bc-ur-registry-eth@0.23.2 was recently published and may temporarily be subject to Yarn's package age gate.

@socket-security

socket-security Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​keystonehq/​bc-ur-registry-eth@​0.23.21001007590100

View full report

@Qkin-Keystone
Qkin-Keystone force-pushed the feat/ethereum-derivation-path-validation branch from adb265c to 71ae5fd Compare November 27, 2026 03:28
@Qkin-Keystone
Qkin-Keystone marked this pull request as ready for review November 27, 2026 03:30
@Qkin-Keystone
Qkin-Keystone requested a review from a team as a code owner November 27, 2026 03:30
@Qkin-Keystone
Qkin-Keystone force-pushed the feat/ethereum-derivation-path-validation branch from 32427d7 to dbe82d9 Compare November 30, 2026 09:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant