An IPv6 address joined with its port, as in a Port Change notification, cannot be told from the port #270

Open
opened 2026-10-13 12:50:07 +02:00 by clawbot · 0 comments
Collaborator

Found in the trial run for #260, on next at e8b4006.

An address and port are joined as fmt.Sprintf("%s:%d", ip, port) (internal/watcher/watcher.go, buildPortAssociations, checkSinglePort, checkTLSForHostname, checkTLSCert). For an IPv6 address this gives text such as 2a01:4f8:2200:fd11::1:80, which is also a valid IPv6 address on its own, so a reader cannot tell the address from the port. The trial sent:

Port Change: 2a01:4f8:2200:fd11::1:80
Hostnames: git.eeqj.de
Address: 2a01:4f8:2200:fd11::1:80
Port now closed

The same text is the port's key in the state file and in /api/v1/status, the Ports table on the dashboard, and the address part of certificate keys.

Done when:

  • Every address joined with a port, in keys, notifications, the dashboard and the API, is written with net.JoinHostPort, so an IPv6 address is in brackets ([2a01:4f8:2200:fd11::1]:80) and an IPv4 one is unchanged; keys are split with net.SplitHostPort.
  • Tests cover an IPv6 address: a port key, a certificate key, and a Port Change message.
  • The README's State File Format section says an IPv6 address is written in brackets in these keys.

Severity: minor

Model: opus-5-5

Found in the trial run for https://git.eeqj.de/sneak/dnswatcher/issues/260, on `next` at `e8b4006`. An address and port are joined as `fmt.Sprintf("%s:%d", ip, port)` (`internal/watcher/watcher.go`, `buildPortAssociations`, `checkSinglePort`, `checkTLSForHostname`, `checkTLSCert`). For an IPv6 address this gives text such as `2a01:4f8:2200:fd11::1:80`, which is also a valid IPv6 address on its own, so a reader cannot tell the address from the port. The trial sent: ``` Port Change: 2a01:4f8:2200:fd11::1:80 Hostnames: git.eeqj.de Address: 2a01:4f8:2200:fd11::1:80 Port now closed ``` The same text is the port's key in the state file and in `/api/v1/status`, the Ports table on the dashboard, and the address part of certificate keys. Done when: - Every address joined with a port, in keys, notifications, the dashboard and the API, is written with `net.JoinHostPort`, so an IPv6 address is in brackets (`[2a01:4f8:2200:fd11::1]:80`) and an IPv4 one is unchanged; keys are split with `net.SplitHostPort`. - Tests cover an IPv6 address: a port key, a certificate key, and a Port Change message. - The README's State File Format section says an IPv6 address is written in brackets in these keys. Severity: minor Model: opus-5-5
clawbot added this to the 1.0 milestone 2026-10-13 12:50:07 +02:00
clawbot self-assigned this 2026-10-13 12:50:07 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/dnswatcher#270