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

wire: fix IPv4-mapped IPv6 addresses using wrong networkID in addrv2

Public commit record

What the developer wrote

Authored by Calvin Kim

73/100 · Adequate
wire: fix IPv4-mapped IPv6 addresses using wrong networkID in addrv2

Go's net.ParseIP stores IPv4 addresses as 16-byte IPv4-mapped IPv6
addresses (::ffff:x.x.x.x). NetAddressV2FromBytes dispatches on
address length, so these 16-byte addresses were incorrectly matched
as IPv6 and serialized with networkID 0x02 (IPv6) instead of 0x01
(IPv4). BIP-155 doesn't forbid this, but Bitcoin Core silently drops
them anyway (undocumented, naturally). Detect IPv4-mapped IPv6
addresses and extract the 4-byte IPv4 address with the correct
networkID.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug where IPv4 addresses were accidentally advertised as IPv6 addresses on the Bitcoin peer-to-peer network. Because of how Go stores IP addresses internally, a 16-byte IPv4-mapped IPv6 representation was being tagged with the IPv6 network type. Bitcoin Core silently ignores such mixed messages, so affected btcd nodes could have had their address announcements ignored by peers, potentially hurting connectivity and peer discovery. There is no direct evidence this was exploited as an attack.

Recommended action

Apply the patch. Monitor for any peer connectivity or address relay anomalies on nodes running the unfixed code. Consider adding tests for IPv4-mapped IPv6 handling in addrv2 serialization/deserialization.

Security signals we found

01

Protocol-layer address misclassification

02

Peer-to-peer network address propagation issue

03

Interoperability failure with Bitcoin Core

04

Potential peer connectivity / eclipse-related side effects

05

No input validation bypass or memory corruption evident

Risk score

Why this scored 51/100

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