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

Refuse mixed base paths on single sig segwit v0

Public commit record

What the developer wrote

Authored by kdmukai

95/100 · Strong
Refuse mixed base paths on single sig segwit v0

Change may come back to the base path of any of our inputs, so each
input's base path has to be genuine. A segwit v0 signature (BIP-143)
commits to its own input's script and amount, not to the other
inputs'. A coordinator can add a real utxo of its own whose
witness_utxo falsely claims our key at a base path it chooses. Our
signature on the genuine input is unchanged, the transaction still
confirms, and the added input anchors change at a path the user's
wallet never scans.

On p2wpkh and p2sh-p2wpkh, the inputs this seed signs must now share
one base path unless each supplies a non_witness_utxo, which is checked
against its txid. Otherwise the parse raises
PSBTUnverifiableMixedInputBasePathsError, a Warning-grade refusal.
Taproot signatures commit to every input's script and amount, and a
legacy input must supply its previous transaction. Multisig change is
checked against the full set of cosigners. The tests that spent from
two base paths on p2wpkh now use the other script types.

Every base path comparison now goes through PSBTParser._get_base_path.
A one-level slip in one of the separate slices it replaces passed the
whole suite.

Held input findings are raised before this check too, since it reads
the same input claims. parse()'s docstring now says a held finding
waits only until a later check would rely on what it set aside.

Also rewords a few docstrings from this branch's earlier commits.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a security flaw in SeedSigner, a small hardware wallet used to sign Bitcoin transactions. The bug could let a malicious transaction coordinator trick the device into accepting change money sent to a wallet path the user never monitors, potentially making funds appear lost. The fix refuses to sign certain single-signature SegWit v0 transactions when inputs come from different wallet paths and the full previous transaction data is missing. The commit message and code clearly describe the attack and the fix.

Recommended action

Treat this as a security fix. Review the new _evaluate_input_base_paths logic for completeness, ensure the UI correctly prevents signing in all code paths, and verify that the test coverage includes edge cases such as collaborative spends with foreign inputs and PSBTs where only some inputs provide non_witness_utxo.

Security signals we found

01

New security check explicitly described as preventing a malicious coordinator from anchoring change to an unmonitored derivation path

02

New exception class PSBTUnverifiableMixedInputBasePathsError with Warning-grade refusal

03

UI flow now redirects to a blocking warning screen instead of allowing signing

04

Tests added for both the refusal case and the allowed case with non_witness_utxo

05

Existing tests that spent from two base paths on p2wpkh were moved to taproot/legacy/multisig script types

06

Centralized base-path extraction into _get_base_path() to prevent inconsistent slicing

Risk score

Why this scored 69/100

Our methodology →
Potential impact 22/30
Exploitability 12/25
Stealth signal 11/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.