Skip to content

13.x: do not fulfill BIP32 requests outside descriptor path - #1010

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

13.x: do not fulfill BIP32 requests outside descriptor path#1010
apoelstra merged 2 commits into
rust-bitcoin:release-13.xfrom
noahjoeris:13.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

@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 651715a; successfully ran local tests

@apoelstra
apoelstra merged commit 26f988b into rust-bitcoin:release-13.x Jul 31, 2026
30 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