AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
High 76 Bitcoin

Harden BIP322 POR foreign-input check

Public commit record

What the developer wrote

Authored by scgbckbone

83/100 · Strong
Harden BIP322 POR foreign-input check

Gate on required_key instead of num_our_keys: keypath metadata is
attacker-controlled, and the zero-xfp placeholder is rewritten to our
fingerprint on the fly, so a foreign input carrying a forged keypath
plus a partial signature looked both 'ours' and already-signed, and
was never rejected nor signed - while the SIGHASH_ALL signature over
input zero still committed to its prevout.

required_key is only set after the input's pubkey/scripts validate
against our seed or WIF store, so gating on it fails closed for all
three variants: no keypaths, forged keypaths, and presigned inputs.

Add regression test with a foreign UTXO (different seed) carrying a
zero-xfp keypath and a garbage partial signature.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug in COLDCARD's BIP-322 Proof of Reserves (POR) feature. POR lets a wallet prove it controls certain bitcoins without moving them. The bug allowed an attacker to include someone else's unspent coin in the proof by disguising it with fake key-path metadata and a bogus partial signature. The device would then treat that foreign input as already signed and belonging to the wallet, making the proof falsely claim control of funds the wallet does not actually own. The fix checks that the device can actually derive the required signing key for each input, rather than relying on attacker-controlled key-path data.

Recommended action

Users relying on BIP-322 Proof of Reserves should upgrade to a release containing this fix before trusting POR assertions. Review any past POR signatures for unexpected inputs if the signer ran vulnerable firmware. Developers should ensure similar checks use cryptographically validated required_key rather than attacker-controlled metadata.

Security signals we found

01

Bypass of foreign-input rejection in BIP-322 Proof of Reserves

02

Attacker-controlled PSBT keypath metadata used to spoof wallet ownership

03

Partial signature used to make foreign input appear already signed

04

Fix gates on required_key (cryptographic validation) instead of num_our_keys (metadata matching)

05

Regression test demonstrates exploit with foreign seed-derived key and zero-XFP keypath

Risk score

Why this scored 76/100

Our methodology →
Potential impact 22/30
Exploitability 18/25
Stealth signal 12/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.