Closed NiKiZe closed 1 year ago
In #22 case-insensitive hashing was mentioned and resolved.
matchSuffix should (at least most of the time) be case insensitive https://datatracker.ietf.org/doc/html/rfc4343
>>> from dnslib.dns import DNSLabel >>> l = DNSLabel("test.example.Com") >>> l <DNSLabel: 'test.example.Com.'> >>> l.matchSuffix("example.Com") True >>> l.matchSuffix("example.com") False >>>
The last command is False, expected True
It is seen in the wild that requests are coming in especially as .ip6.arpa. and .IP6.ARPA.
.ip6.arpa.
.IP6.ARPA.
Originally posted by @NiKiZe in https://github.com/paulc/dnslib/issues/22#issuecomment-1030912336
Possible Fix:
@@ -113,14 +115,14 @@ class DNSLabel(object): Return True if label suffix matches """ suffix = DNSLabel(suffix) - return self.label[-len(suffix.label):] == suffix.label + return DNSLabel(self.label[-len(suffix.label):]) == suffix
In #22 case-insensitive hashing was mentioned and resolved.
matchSuffix should (at least most of the time) be case insensitive https://datatracker.ietf.org/doc/html/rfc4343
The last command is False, expected True
It is seen in the wild that requests are coming in especially as
.ip6.arpa.
and.IP6.ARPA.
Originally posted by @NiKiZe in https://github.com/paulc/dnslib/issues/22#issuecomment-1030912336
Possible Fix: