Closed Bug 1870497 Opened 5 months ago Closed 3 months ago

DNS resolution fails if a CNAME target begins with a hyphen

Categories

(Core :: Networking: DNS, defect, P2)

Firefox 120
defect

Tracking

()

RESOLVED MOVED

People

(Reporter: bugzilla.mozilla.simon, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

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.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

All of these work in Chrome 120.0.6099.109 and Chromium 119.0.6045.159 (including the A names as URLs).

For testing, there's a list of links to hostnames set up like this at https://gist.github.com/nomis/e4d32435f199aeffbf64197dc55b5ba9.

Component: Widget: Gtk → Networking: DNS
Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Duplicate of bug: 1870496
Resolution: --- → DUPLICATE

This is not a duplicate of Bug 1870496. That bug is for Firefox on Android. This bug is for Firefox on Linux.

Status: RESOLVED → UNCONFIRMED
No longer duplicate of bug: 1870496
Resolution: DUPLICATE → ---
Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged][necko-priority-new]
See Also: → 1870496
Whiteboard: [necko-triaged][necko-priority-new] → [necko-triaged][necko-priority-review]
Flags: needinfo?(kershaw)

I think we should file a bug in glibc - this behaviour comes from getaddrinfo.

Flags: needinfo?(kershaw)
Whiteboard: [necko-triaged][necko-priority-review] → [necko-triaged]

What is your glibc version? We fixed it in upstream version 2.37, and backported it to the release branches up to and including glibc 2.34.

Flags: needinfo?(bugzilla.mozilla.simon)

I'm using 2.31-0ubuntu9.14 (Ubuntu 20.04.6 LTS).

Testing with getaddrinfo() directly, it also happens on 2.35-0ubuntu3.6 (Ubuntu 22.04.3 LTS) so they've not applied any bug fixes. Fedora 39 (with 2.38) is ok.

Flags: needinfo?(bugzilla.mozilla.simon)

Thanks, I suggest reporting this to the Ubuntu team then: https://bugs.launchpad.net/ubuntu/+source/glibc

This has been fixed in glibc at Bug 12154. Opened a bug at Ubuntu https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2055302. This bug can be closed at any case.

Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago3 months ago
Resolution: --- → MOVED
You need to log in before you can comment on or make changes to this bug.