URL parser discards host for file: URLs
Categories
(Core :: Networking, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox65 | --- | unaffected |
firefox120 | --- | unaffected |
firefox121 | --- | unaffected |
firefox122 | --- | wontfix |
People
(Reporter: loganfsmyth, Assigned: twisniewski)
References
(Depends on 1 open bug, Blocks 4 open bugs, Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
Attachments
(2 files)
Comment 1•6 years ago
|
||
Comment 3•6 years ago
|
||
Updated•4 years ago
|
Comment 6•4 years ago
•
|
||
The URL spec is somewhat confusing on this point. §4.1 has a table showing the host can be a domain or IP address, and there's a lot of parsing logic in §4.4 talking about how to get the host part, and then §4.2 says
A URL cannot have a username/password/port if its host is null or the empty string, its cannot-be-a-base-URL is true, or its scheme is "file".
"file" isn't a particular protocol, so how are you supposed to talk to the remote host? Why can't it require auth or a non-standard port? RFC 1734 was pretty clear that if there was a host part it had to be one of a few synonyms for the local machine (see bug 376502). When did arbitrary domains get into the picture, and has anyone ever implemented that? I thought multiple implementations was a requirement for WHATWG specs?
After a quick look it appears Firefox and Safari simply ignore a host part, and Chrome considers it an error. I'm with Chrome on that one.
From a security POV it would be terrible to support it in today's browsers because too much code has made assumptions about "file:" meaning "local" since the earliest specs for the WWW.
Comment 8•4 years ago
|
||
Based on https://jsdom.github.io/whatwg-url/#url=ZmlsZTovL3Rlc3QvdGVzdA==&base=YWJvdXQ6Ymxhbms= both Chrome and Safari allow a host, Firefox does not. As I understand it this can be important on Windows.
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Just FYI, RFC 8089 is a more current standards document that solely covers the file URI scheme. It is much more thorough and detailed compared to the relatively spartan explanation offered in RFC 1734 (which was limited to a single section).
Assignee | ||
Comment 10•2 years ago
|
||
This is the root cause of us failing lots of web platform tests for interop2023, based on the kinds of failures I'm seeing after bug 1347459 comment 6:
new URL("file://hi/path").protocol = "s" will keep the protocol as "file" as expected, but will drop the "hi" part of the URL and add a root slash: file:///path
I've put together a candidate patch which changes our behavior to better-match the URL spec and related url WPTs, which builds on top of the patch in bug 1347459 (passing 160 more WPT checks). I'll upload it ASAP for comments.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 11•2 years ago
|
||
Assignee | ||
Comment 12•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D183061
Assignee | ||
Comment 14•1 year ago
|
||
I just rebased the patches, with updated test expectations (including some wins in url/failure.html, which we weren't seeing before, due to that test crashing on our harness until bug 1722328 was partly addressed).
Comment 15•1 year ago
|
||
https://phabricator.services.mozilla.com/D183061#6091970 completely fell off my radar. I'm sorry! Tagging myself here in the bug because I couldn't figure out a way to get it into any of my queues in phabricator
Comment 16•1 year ago
|
||
Set release status flags based on info from the regressing bug 1722328
Updated•1 year ago
|
Comment 17•1 year ago
|
||
Hi :twisniewski - we are in soft code freeze for Fx112, Merge Day is on 2023-12-18. The patches for this are reviewed but from a few months ago.
I was wondering what expectations are, if this is something you plan on landing?
If it doesn't land not before merge day, will you be looking for an uplift?
Assignee | ||
Comment 18•1 year ago
|
||
No, I don't mean to land this until :dveditz has time to properly consider the open comments on the patch first. When we do land it, I think we would want it to ride the release trains rather than sneaking it in last-minute or uplifting.
Comment 19•1 year ago
|
||
Thanks for the info, setting 122 to fix-optional for now. I can set it to wontfix later in the cycle.
Updated•1 year ago
|
Updated•5 months ago
|
Description
•