rkrux
commented at 6:49 am on December 5, 2025:
contributor
Throw error while deserializing PSBT if invalid pubkeys are passed
as a MuSig2 aggregate or participant.
Should fix #33999 & #34201 by throwing error at the very start while decoding
an invalid PSBT that should subsequently not allow the MuSig2
signing operation to take place, thereby avoiding the crash.
DrahtBot added the label
Wallet
on Dec 5, 2025
DrahtBot
commented at 6:49 am on December 5, 2025:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
rkrux
commented at 2:08 pm on December 5, 2025:
contributor
Yes, the second constructor appears to be involved. This comment here suggests where the error lies because of an empty aggregate pubkey added in the fuzz input: #29675 (review)
theStack
commented at 2:34 pm on December 5, 2025:
contributor
Oh right, the crash already happens in the std::span{pubkey}.subspan(1, 32) expression (if std::span{pubkey} is empty due to being invalid), before the first constructor is called. It seems we should detect invalid participant pubkeys as early as possible and not allow them to be added to the wallet state in the first place, I suspect a better place to fix this would be DeserializeMuSig2ParticipantPubkeys, where a validity check is currently missing.
rkrux
commented at 3:34 pm on December 5, 2025:
contributor
I did think about adding it there but decided against it to keep the change related to the crash site. But I don’t feel strongly about it and will update the PR to add the check in PSBT deserialization.
fanquake requested review from achow101
on Dec 5, 2025
fjahr
commented at 11:55 pm on December 5, 2025:
contributor
Could you add a simple test for this?
rkrux force-pushed
on Dec 8, 2025
rkrux renamed this:
wallet: check for `agg_pub` validity in MuSig2 signing
psbt: detect invalid MuSig2 pubkeys in deserialization
on Dec 8, 2025
rkrux
commented at 2:32 pm on December 8, 2025:
contributor
I suspect a better place to fix this would be DeserializeMuSig2ParticipantPubkeys, where a validity check is currently missing.
Updated PR to add the check there instead of in the MuSig2 signing flow that occurs later.
Could you add a simple test for this?
Added few tests from the fuzz inputs and created one more test so that the test coverage of an existing if condition that appears at the end of DeserializeMuSig2ParticipantPubkeys is not lost due to the newly added check for invalid participant pubkey.
achow101
commented at 10:53 pm on December 23, 2025:
member
ACK1818f7028e592e52a61b57a67e32eacda78553f9
psbt: detect invalid MuSig2 pubkeys in deserialization
Throw error while deserializing PSBT if invalid pubkeys are passed
as a MuSig2 aggregate or participant.
5805a8b540
rkrux force-pushed
on Jan 5, 2026
rkrux
commented at 10:55 am on January 5, 2026:
contributor
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-01-08 03:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me