Skip to content

Reject IPv6 domain literals with a zone index - #177

Merged
JoshData merged 1 commit into
JoshData:mainfrom
youdie006:ipv6-zone-index
Oct 1, 2026
Merged

JoshData merged 1 commit into
JoshData:mainfrom
youdie006:ipv6-zone-index

Conversation

@youdie006

Copy link
Copy Markdown
Contributor

Since Python 3.9, ipaddress.IPv6Address accepts a zone index, so with allow_domain_literal=True me@[IPv6:fe80::1%eth0] validates. So does me@[IPv6:::1%]], whose normalized address keeps the extra ]. RFC 5321's IPv6-addr has no zone index, so this rejects addresses whose scope_id is set.

The test also checks that [IPv6:::ffff:1.2.3.4] is still accepted.

Written with AI assistance (Claude); I have reviewed the change.

ipaddress.IPv6Address accepts '%scope' since Python 3.9, but RFC 5321's
IPv6-addr has no zone index, so 'me@[IPv6:fe80::1%eth0]' was accepted.
@JoshData
JoshData merged commit 8ae8d01 into JoshData:main Oct 1, 2026
5 checks passed
@JoshData

JoshData commented Oct 1, 2026

Copy link
Copy Markdown
Owner

TY

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.

2 participants