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

fix: reject base58 address with unknown version byte in parse_address

Public commit record

What the developer wrote

Authored by kkdao

93/100 · Strong
fix: reject base58 address with unknown version byte in parse_address

address_to_scriptpubkey returns None (no exception) for a base58 address
with a valid checksum but a version byte matching no network. The final
parse_address block only caught exceptions, so such an address was
returned as valid. Capture the return and require a Script. Per review
on #898.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This fix closes a hole where a Bitcoin address that looks valid (correct checksum) but belongs to no known network could be accepted by Krux's address parser. Before the patch, the parser only caught thrown errors; because the underlying library quietly returns nothing for an unknown address version, such an address slipped through as valid. The patch now checks that a real script output was produced and rejects the address otherwise. This could matter if a user scanned a malformed or wrong-network address and the device treated it as valid.

Recommended action

Review whether any other callers of address_to_scriptpubkey() in the codebase assume it always returns a Script or raises; add similar None checks if needed. Confirm the new regression test covers mainnet/testnet version mismatches as well as entirely unknown version bytes.

Security signals we found

01

Input validation bypass fixed

02

Base58 address version byte not validated before fix

03

Library silent failure (None return) not handled by caller

04

Regression test added for malformed-but-checksum-valid address

Risk score

Why this scored 62/100

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