Bug 31413 - getaddrinfo: DNS resolution fails if a CNAME target begins with a hyphen
Summary: getaddrinfo: DNS resolution fails if a CNAME target begins with a hyphen
Status: RESOLVED DUPLICATE of bug 12154
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-26 10:42 UTC by Manuel Bucher
Modified: 2024-02-27 11:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fw: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Bucher 2024-02-26 10:42:29 UTC
Clone of Firefox Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1870497

> User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
> 
> Steps to reproduce:
> 
> Set up the following DNS records:
> 
> www1.test A 192.0.2.1
> _www2.test A 192.0.2.1
> www3._www3.test A 192.0.2.1
> www_4.test A 192.0.2.1
> -www5.test A 192.0.2.1
> www6.-www6.test A 192.0.2.1
> 
> cname1.test CNAME www1.test
> cname2.test CNAME _www2.test
> cname3.test CNAME www3._www3.test
> cname4.test CNAME www_4.test
> cname5.test CNAME -www5.test
> cname6.test CNAME www6.-www6.test
> 
> Open all of the "cname1" to "cname6" hostnames as URLs in Firefox.
> 
> Actual results:
> 
> The "cname5" hostname returns "Server Not Found".
> 
> The other names can be resolved and Firefox will connect to them.
> 
> Expected results:
> 
> All of "cname1" to "cname6" can be resolved and Firefox will connect to them.
> 
> The hostnames used in CNAME targets (or chains of CNAME targets) should not be subject to the same validation as the hostname in the URL.

In Firefox on Linux we use glibc getaddrinfo to resolve hostnames. I think fixing this in glibc would be best.
Comment 1 Florian Weimer 2024-02-26 21:31:42 UTC
On which glibc versions do you observe this?

This should have been fixed under bug 12154.
Comment 2 Florian Weimer 2024-02-27 11:07:41 UTC
Per https://bugzilla.mozilla.org/show_bug.cgi?id=1870497#c7 this is already fixed in current glibc—it's a duplicate of bug 12154.

*** This bug has been marked as a duplicate of bug 12154 ***