URL host parser does not accept * or "
Categories
(Core :: Networking, defect, P1)
Tracking
()
People
(Reporter: valentin, Assigned: valentin)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome, parity-safari, webcompat:platform-bug, Whiteboard: [necko-triaged],[necko-priority-queue] webcompat:risk-high)
User Story
user-impact-score:2400
Attachments
(2 files, 1 obsolete file)
We're failing to parse the following URL
Origin parsing: http://!"$&'()*+,-.;=_`{}~/ against <about:blank>
Comment 1•3 years ago
|
||
- and " should be valid characters when parsing a host.
WIP. TODO:
- Find and retest relevant WPT tests to validate changes
- Update WPT expectations
Depends on D170528
Updated•3 years ago
|
Updated•3 years ago
|
Comment 2•2 years ago
|
||
Oliver, are you still working on this?
Comment 3•2 years ago
|
||
Sorry, no, I abandoned the patch last week after Valentin said a while ago that there are many various internal changes needed as we do expect none of these characters in a few places currently.
This bug will not be handled as a part of interop-2024-url, but will likely need addressing for the purposes of URL Pattern.
Updated•2 years ago
|
Comment 6•2 years ago
|
||
In order to keep the scope of bug 1889536 manageable, I intend not to fix this as part of that bug. However, for future reference, I'm in the process of moving the relevant ASCII deny list declaration from nsStandardURL.cpp to netwerk/base/idna_glue/src/lib.rs.
Comment 7•2 years ago
|
||
Filed bug 1912011 about taking an already-possible step in this direction.
Comment 8•2 years ago
|
||
Let's see the current status of test breakage if we did this:
https://treeherder.mozilla.org/jobs?repo=try&revision=1d9e2b73dc599341dc4997d04768dfbaba188bad
Comment 9•2 years ago
|
||
Quota manager expects nsStandardURL host names to be usable as file names on Windows, so there's this assertion:
https://searchfox.org/mozilla-central/rev/891d104826fb0cfd5cbdd6128e2372ce62810028/caps/OriginAttributes.cpp#292
(See bug 1196371.)
Resolving the above in a way that doesn't break anything is probably the main task left here. bvandersloot, do you have advice on what the issues are here?
The cookie permission UI wants the asterisk to be rejected in URLs:
https://searchfox.org/mozilla-central/source/browser/components/preferences/tests/browser_permissions_checkPermissionsWereAdded.js
https://searchfox.org/mozilla-central/source/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js also tests for asterisk invalidity in extension origin match, but to me it looks like a test-only issue.
Comment 10•2 years ago
|
||
Added a comment on a relevant spec issue: https://github.com/whatwg/url/issues/815#issuecomment-2275009761
Comment 11•2 years ago
|
||
Re quota manager (this isn't my area of expertise): we probably have to sanitize the url string for use as filename, since the acceptable characters of URLs are not a subset of that for files on windows. But I'd talk to :asuth for more info there.
Re cookie permission: we disallow the user from setting permission exemptions with a *, in order to prevent the confusion that they can set wildcards. This would require some UI change. Although we have a clean way to do this- strip the *. and it should work as the user expects. Then we can just permit * so foo*.example.com would be allowed. :pbz - does that sound reasonable as a solution here, since you know more about permissions than me?
I expect the last example to be a similar consideration, given this test line but I don't know enough about extensions to be certain.
Comment 12•2 years ago
|
||
(In reply to Benjamin VanderSloot [:bvandersloot] from comment #11)
Re cookie permission: we disallow the user from setting permission exemptions with a *, in order to prevent the confusion that they can set wildcards. This would require some UI change. Although we have a clean way to do this- strip the
*.and it should work as the user expects. Then we can just permit*sofoo*.example.comwould be allowed. :pbz - does that sound reasonable as a solution here, since you know more about permissions than me?
We could add a check that reads the host from the parsed URL in the cookie permission UI code and rejects it if it contains an asterisk even if nsStandardURL itself didn't reject the asterisk. After all, the asterisk is used as a wildcard on the TLS certificate layer, which means we've already rather committed to not supporting a literal asterisk in DNS naming.
Comment 13•2 years ago
•
|
||
There is no explicit check for "*" in the frontend. The URI constructor here fails for inputs like "*.example.com" here: https://searchfox.org/mozilla-central/rev/10fcb8561f56db489a5a7a69e1f01392bcecd830/browser/components/preferences/dialogs/permissions.js#309
Comment 14•2 years ago
|
||
(In reply to Paul Zühlcke [:pbz] from comment #13)
There is no explicit check for "*" in the frontend. The URI constructor here fails for inputs like "*.example.com" here: https://searchfox.org/mozilla-central/rev/10fcb8561f56db489a5a7a69e1f01392bcecd830/browser/components/preferences/dialogs/permissions.js#309
Yes, I think Benjamin's question (in comment #11, after comment #9) is, if we change the URI constructor to not throw, can we add frontend checks so we would do the right thing when the host contains *.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•4 months ago
|
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 16•4 months ago
|
||
| Assignee | ||
Comment 17•4 months ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #9)
Quota manager expects
nsStandardURLhost names to be usable as file names on Windows, so there's this assertion:
https://searchfox.org/mozilla-central/rev/891d104826fb0cfd5cbdd6128e2372ce62810028/caps/OriginAttributes.cpp#292
(See bug 1196371.)
I still need to fix this bit.
| Assignee | ||
Comment 18•3 months ago
|
||
Comment 19•3 months ago
|
||
Comment 20•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/32304afd4381
https://hg.mozilla.org/mozilla-central/rev/afbc979cf372
Updated•3 months ago
|
Description
•