ladybird/Tests/LibDNS
François Guerraz f756219841 LibDNS: Reject domain name labels longer than 63 octets
A DNS label length octet is a 6-bit value, so a label can be at most 63
octets. Several code paths violated this and aborted the process:

- DomainName::from_raw() treated any length octet that was not a
  compression pointer as an ordinary label, including the reserved
  0b01/0b10 top-bit encodings, yielding labels of up to 191 octets.
- DomainName::to_raw() then VERIFY-aborted on any label longer than 63
  octets while encoding it back to the wire.
- Resolver::lookup() encoded the outgoing query with MUST(to_raw(...)),
  so even once to_raw() fails gracefully the MUST would still abort.

Together these crash RequestServer, which drives DNS for the whole
browser. When a custom resolver is configured (e.g. --dns-server), a web
page that references a host name containing a label longer than 63
characters aborts RequestServer while the query is encoded. A response
carrying a reserved-length label is also accepted by the parser and then
aborts when the name is re-encoded (for example during DNSSEC
validation).

Reject over-long labels when parsing, return an error instead of
aborting when encoding, and reject the lookup promise instead of
MUST-aborting at the query call site.
2026-06-04 17:41:09 +02:00
..
CMakeLists.txt LibDNS: Reject domain name labels longer than 63 octets 2026-06-04 17:41:09 +02:00
TestDNSMessage.cpp LibDNS: Reject domain name labels longer than 63 octets 2026-06-04 17:41:09 +02:00
TestDNSResolver.cpp LibDNS: Resolve the .localhost special-use domain to loopback 2026-05-29 22:23:33 +02:00