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

btc: reject raw key hashes in policies

Public commit record

What the developer wrote

Authored by benma's agent

78/100 · Adequate
btc: reject raw key hashes in policies

Taproot parsing and sanity_check accept raw public-key-hash leaves,
which are not included in key enumeration. Reject RawPkH in the shared
policy validator before registration or use, including nested fragments.

Correct the stale Taproot parsing comment and cover standalone leaves,
nested expressions, and multi-leaf trees with regression tests.

This also rejects previously registered policies containing this
unsupported fragment when they are used for address derivation or signing.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in the BitBox02 hardware wallet's Bitcoin policy handling. Previously, the wallet accepted a specific type of unsupported script fragment called a 'raw public-key hash' (RawPkH) inside Taproot wallet policies. Because these fragments were not tracked as keys, they could silently alter how addresses were derived or how transactions were signed, potentially allowing a malicious or malformed policy to behave in unexpected ways. The fix rejects any policy containing RawPkH, including when it is nested inside other expressions, and also rejects already-registered policies that contain it when they are later used.

Recommended action

Treat this as a security-hardening fix with potential exploitability. Review whether any user-registered Taproot policies on shipped devices contain RawPkH fragments and consider migration or rejection at firmware load time. Ensure the updated validate_miniscript() path is also applied to any other descriptor types that may parse leaves independently.

Security signals we found

01

Unsupported Miniscript fragment accepted by parser

02

Key enumeration mismatch: RawPkH leaf not counted as a key

03

Taproot leaf sanity check bypassed during parsing

04

Policy validation gap affects both registration and later use

05

Regression tests added for nested and multi-leaf cases

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/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.