mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2452] Handling of full stops in labels #993
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#993
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @divergentdave on GitHub (Sep 12, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2452
This issue is following up on previous discussions in #2419 and #2433. Currently, IDNA labels that include a full stop do not get encoded as UTF-8 correctly, because full stops are unescaped. (ASCII labels do have full stops escaped correctly when they are encoded) If a domain name is built from these strings later, then the internal full stops will get interpreted as separating labels, rather than being part of a label.
I previously found that full stops inside labels were primarily used for representing email addresses as domain names, for use with various now-defunct resource record types. Unfortunately, that's not the whole story. The SOA record's RNAME field is a mailbox represented as a domain name in this same way. (
dig SOA google.comprintsdns-admin.google.com, which represents the emaildns-admin@google.com. Twitter is the exception that proves the rule, because their SOA listsnoc\@twitter.com.) I did some digging to see if this could be a practical problem, and found a potentially affected zone by searching through a public dataset of DNS packet captures.dig SOA adadvisor.netincludes a full stop in the local part of the email address (escaped with a backslash when printed bydig).Thus, I don't think it would be practical to simply disallow full stops in labels. The
SOAstruct usesNameto represent theRNAMEfield currently. Any lookup inside theadadvisor.netzone, or any similarly affected zone, which triggers anSOArecord in the authority section of the response, would fail when trying to parse this field.I believe the two main options at this point are to still allow full stops in
Label/Name, fixing the encoding and any other related bugs, or to have two separate types for names that do and don't allow full stops in labels, and switch thernamefield to the former.@djc commented on GitHub (Sep 12, 2024):
Thanks for digging deeper on this!
Which of these two do you think we should pick? Do you have a preference, and why? On the face of it, I like the latter option of having a different type for holding the
rname, assuming we can get away with not having too much extra complexity for it. (But since I don't think we have any further interpreting of that field's constants, it seems okay?)(I'm a little confused by the use of "full stop" instead of maybe "period" -- is there a reason to use that terminology?)
@divergentdave commented on GitHub (Sep 13, 2024):
I think I prefer keeping one set of label/name types. The
RNAMEfield can use the same domain name compression as many other domain name fields, so we do need to parse it. Domain name handling logic is a lot of complexity as it is, so I'm loathe to duplicate it; if we have to get email encoding "right" once, we may as well use it for all domain names.I picked this up from staring at UTS #46, as that's the Unicode name of U+002E, but yeah, same thing.
@djc commented on GitHub (Sep 16, 2024):
Alright, I think your reasoning makes sense. @marcus0x62 opinions?
@marcus0x62 commented on GitHub (Sep 17, 2024):
I think it makes sense to implement this in Name -- we already have Name and LowerName, and while I guess we could add an "UnrestrictedName" or something, that seems like more trouble than it is worth. There are already many situations where the difference in helper methods between the two name types is inconvenient.
We could add helper methods for constructing new names to guarantee a name has only the "preferred" characters from RFC1035 where that is desired and/or to detect if a name has non-preferred characters.