Skip to content

fix(tools): stop reading scope operators as leaked IPv6 addresses - #63

Merged
QuiteYellow merged 1 commit into
mainfrom
fix/share-safety-reserved-ipv6
Aug 23, 2026
Merged

fix(tools): stop reading scope operators as leaked IPv6 addresses#63
QuiteYellow merged 1 commit into
mainfrom
fix/share-safety-reserved-ipv6

Conversation

@QuiteYellow

Copy link
Copy Markdown
Owner

check_share_safety.py reads a C++ or Rust scope operator as a leaked IPv6 address and fails the build.

Surfaced on #60, where the line

- the leaf's `TbsCertificate::signature_alg` is one `cryptography` refuses to

reports NON_DOCUMENTATION_IPV6. IPV6_RE allows empty hex groups, so it matches e:: out of ...ficate::signature, and ipaddress parses that as a valid address in the all-zero reserved block. Any scope operator preceded by a hex letter does it.

The fix

_safe_ipv6 now also accepts an address in an IETF-reserved block. Such an address is not assignable to a host, so it cannot be the leak the rule exists to catch. Global unicast, link-local and unique-local all sit outside the reserved set and stay flagged, which is the whole population of real leaks: a device on somebody's LAN has one of those three.

Tightening the regex was the alternative and it is worse. The obvious tightening, requiring a substantial first group, drops link-local addresses, which are exactly what leaks out of a capture.

Residual gap

A NAT64-prefixed address written entirely in hex now passes. The dotted-tail form of the same address is still caught by IPV4_RE on the same line. Contriving the hex form as an exfiltration route seems less likely than the false positive it costs.

Tests

Two added: scope operators in the shapes that appear in these docs produce no findings, and link-local, unique-local and global unicast each still report NON_DOCUMENTATION_IPV6. Both follow the file's existing convention of splitting literals so the test file does not trip the checker scanning it.

405 pass, and the checker scans its own source and tests clean. #60's document scans clean with no change to it.

IPV6_RE allows empty hex groups, so a C++ or Rust scope operator
preceded by a hex letter matches: TbsCertificate::signature_alg yields
"e::", which ipaddress parses as a valid address in the all-zero
reserved block. #60 fails share-safety on exactly that line.

_safe_ipv6 now also accepts an address in an IETF-reserved block. Those
are not assignable to a host, so they cannot be the leak this rule
exists to catch, while global unicast, link-local and unique-local stay
flagged and cover every real case.

Tightening the regex instead would drop link-local addresses, which are
the ones that leak out of captures.
@QuiteYellow
QuiteYellow merged commit 8b54987 into main Aug 23, 2026
8 checks passed
@QuiteYellow
QuiteYellow deleted the fix/share-safety-reserved-ipv6 branch August 23, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant