Skip to content

12.x: do not fulfill BIP32 requests outside descriptor path - #1011

Open
noahjoeris wants to merge 2 commits into
rust-bitcoin:release-12.xfrom
noahjoeris:12.x/get-key-master-xprv-sibling-paths
Open

12.x: do not fulfill BIP32 requests outside descriptor path#1011
noahjoeris wants to merge 2 commits into
rust-bitcoin:release-12.xfrom
noahjoeris:12.x/get-key-master-xprv-sibling-paths

Conversation

@noahjoeris

Copy link
Copy Markdown
Contributor

Backport of #1004.

Fixes bypassing descriptor path validation for GetKey on sibling paths.

Remove the early `Xpriv::get_key` return in `DescriptorSecretKey::get_key`.
That path matched on fingerprint only and ignored derivation path / wildcard,
so a master xprv in e.g. `.../0/*` would sign sibling paths like `.../9/7`.
Rely on `matches()` only.

Assisted-by: Grok 4.5
Regression: master xprv descriptors such as `.../0/*` must not fulfill
`KeyRequest::Bip32` for sibling paths like `.../9/7`.

Assisted-by: Grok 4.5
@noahjoeris
noahjoeris force-pushed the 12.x/get-key-master-xprv-sibling-paths branch from 10dab0d to 9667f8e Compare July 28, 2026 11:39
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