Skip to content

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

Merged
apoelstra merged 2 commits into
rust-bitcoin:release-12.xfrom
noahjoeris:12.x/get-key-master-xprv-sibling-paths
Jul 31, 2026
Merged

12.x: do not fulfill BIP32 requests outside descriptor path#1011
apoelstra merged 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

@apoelstra apoelstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9667f8e; successfully ran local tests

@apoelstra
apoelstra merged commit 7f17858 into rust-bitcoin:release-12.x Jul 31, 2026
13 checks passed
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.

2 participants