Block redirects to data: URLs
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox114 | --- | fixed |
People
(Reporter: annevk, Assigned: Gijs)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(1 file)
Tests at https://github.com/web-platform-tests/wpt/pull/27463. Some discussion around this at https://github.com/whatwg/fetch/issues/393.
Updated•5 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Comment 1•2 years ago
|
||
We should return an error here if we are redirecting to a data URI and nsILoadInfo.allowInsecureRedirectToDataURI is false.
Optionally we could also add a separate pref for it, in case there's major breakage.
Tests: https://wpt.fyi/results/fetch/redirects/data.window.html?label=experimental&label=master&aligned
https://searchfox.org/mozilla-central/rev/42747dfd314e4c939dc7c33a13e1a2fddf4926fc/testing/web-platform/meta/fetch/redirects/data.window.js.ini
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
Turned out I had a patch for this that I thought didn't work but actually did? So stealing this per conversation on slack... sorry!
| Assignee | ||
Comment 3•2 years ago
|
||
This also adds a network.allow_redirect_to_data pref in case we need to turn
this back on for compat reasons.
Comment 4•2 years ago
|
||
Will this break extensions that use data uri redirects to replace response bodies? (there's some more context in bug 1712096)
Comment 5•2 years ago
|
||
It checks nsILoadInfo.allowInsecureRedirectToDataURI - so presumably those should not be affected.
Updated•2 years ago
|
Comment 6•2 years ago
|
||
(In reply to Gregory Pappas [:gregp] from comment #4)
Will this break extensions that use data uri redirects to replace response bodies? (there's some more context in bug 1712096)
The following comment from within WebRequest.jsm says it should not affect web extensions:
// Web Extensions using the WebRequest API are allowed
// to redirect a channel to a data: URI, hence we mark
// the channel to let the redirect blocker know. Please
// note that this marking needs to happen after the
// channel.redirectTo is called because the channel's
// RedirectTo() implementation explicitly drops the flag
// to avoid additional redirects not caused by the
// Web Extension.
Comment 8•2 years ago
•
|
||
Backed out changeset 736be753a5cf (bug 1691658) for causing xpcshell failures at test_redirect_different-protocol.js, test_redirect_protocol_telemetry.js and test_ext_webidl_api_event_callback.js and test_ext_webidl_api.js
Backout: https://hg.mozilla.org/integration/autoland/rev/23830df06080b6d4ad1a53476b3729c4b7e90f9c
Failure logs:
https://treeherder.mozilla.org/logviewer?job_id=411365251&repo=autoland&lineNumber=4398
https://treeherder.mozilla.org/logviewer?job_id=411363963&repo=autoland&lineNumber=4562
https://treeherder.mozilla.org/logviewer?job_id=411364786&repo=autoland&lineNumber=3658
https://treeherder.mozilla.org/logviewer?job_id=411365989&repo=autoland&lineNumber=3651
| Assignee | ||
Comment 9•2 years ago
|
||
(In reply to Cristina Horotan [:chorotan] from comment #8)
test_ext_webidl_api_event_callback.js and test_ext_webidl_api.js
These don't show up on try, so seem more likely to be related to a different push, e.g. bug 1822763
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
Backed out for causing xpcshell failures in test_redirect_different-protocol_wrap.js.
- Backout link
- Push with failures
- Failure Log
- Failure line: PROCESS-CRASH | netwerk/test/unit_ipc/test_redirect_different-protocol_wrap.js | application crashed [@ libxul.so + 0x000000000024d777]
Comment 12•2 years ago
|
||
| Assignee | ||
Comment 13•2 years ago
•
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #12)
That seems reasonable, yes, and I'll update the patch for that.
Really though, what I would like to know is why the android xpcshell nofis jobs were green on try, and was green on autoland for a little while before then being orange. Like, I am fine fixing the patch but it's not great for sheriffs or for me if I'm playing "how about now" with autoland, given that try apparently doesn't reliably answer "does this pass tests". Do the android xpcshell tests not always run the same tests? Because that feels like a footgun.
FWIW, using test filtering for netwerk/test/unit_ipc/ removes most xpcshell jobs on this autoland filtered result set, and all of the ones on my trypush. But all the android xpcshell jobs that treeherder's chooser offered me were run on that trypush. So where/when do the other tests get run?
Comment 14•2 years ago
|
||
autoland only aims to run all test manifest every 10th or 20th push and that might not apply if that push is a backout or has DONTBUILD in the commit message to prevent more than a skeleton task set from running. All other pushes get less tasks and/or less test manifests in the tasks. netwerk/test/unit_ipc/. Identic task symbols on Treeherder do not represent identic test manifests in the task.
On Try, the push had been scheduled with ./mach try auto which queries the bugbug server for the tasks and tests to schedule: "test_manifest_loader": "bugbug". This did not schedule the mentioned folder. Marco knows how this works (he is out for this week).
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
Backed out for causing wpt failures on browser_datauri.js.
[task 2023-04-11T13:54:42.506Z] 13:54:42 INFO - TEST-START | toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js
[task 2023-04-11T13:54:42.565Z] 13:54:42 INFO - GECKO(22659) | [Child 23467: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 7f448e332c00 == 1 [pid = 23467] [id = 0]
[task 2023-04-11T13:54:42.565Z] 13:54:42 INFO - GECKO(22659) | [Child 23467: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 1 (7f44934c0470) [pid = 23467] [serial = 1] [outer = 0]
[task 2023-04-11T13:54:42.568Z] 13:54:42 INFO - GECKO(22659) | [Child 23467: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 2 (7f448e333400) [pid = 23467] [serial = 2] [outer = 7f44934c0470]
[task 2023-04-11T13:54:42.749Z] 13:54:42 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 7 (7f1972a3a800) [pid = 22818] [serial = 28] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:42.750Z] 13:54:42 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 6 (7f1972a37800) [pid = 22818] [serial = 26] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:42.751Z] 13:54:42 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 7f1972a37000 == 2 [pid = 22818] [id = 14] [url = about:blank]
[task 2023-04-11T13:54:42.751Z] 13:54:42 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 7f1972a39800 == 1 [pid = 22818] [id = 15] [url = about:blank]
[task 2023-04-11T13:54:42.835Z] 13:54:42 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 5 (7f1977b59a40) [pid = 22818] [serial = 31] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:42.836Z] 13:54:42 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 4 (7f1977b59470) [pid = 22818] [serial = 29] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:42.893Z] 13:54:42 INFO - GECKO(22659) | [Child 23467: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 3 (7f448e335000) [pid = 23467] [serial = 3] [outer = 7f44934c0470]
[task 2023-04-11T13:54:42.923Z] 13:54:42 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 7 (7f6b0da20c00) [pid = 22749] [serial = 33] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:42.927Z] 13:54:42 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 6 (7f6b0da1fc00) [pid = 22749] [serial = 35] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:42.929Z] 13:54:42 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 7f6b0da21c00 == 2 [pid = 22749] [id = 16] [url = about:blank]
[task 2023-04-11T13:54:42.931Z] 13:54:42 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 7f6b0da20800 == 1 [pid = 22749] [id = 18] [url = about:blank]
[task 2023-04-11T13:54:42.933Z] 13:54:42 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOCSHELL 7f6b0da1dc00 == 0 [pid = 22749] [id = 17] [url = about:blank]
[task 2023-04-11T13:54:42.999Z] 13:54:42 INFO - GECKO(22659) | [Child 23467, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, NS_ERROR_INVALID_ARG) failed with result 0x80520012 (NS_ERROR_FILE_NOT_FOUND): file /builds/worker/checkouts/gecko/intl/l10n/L10nRegistry.cpp:385
[task 2023-04-11T13:54:43.003Z] 13:54:43 INFO - GECKO(22659) | [Child 23467, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, NS_ERROR_INVALID_ARG) failed with result 0x80520012 (NS_ERROR_FILE_NOT_FOUND): file /builds/worker/checkouts/gecko/intl/l10n/L10nRegistry.cpp:385
[task 2023-04-11T13:54:43.124Z] 13:54:43 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 5 (7f6b12c69e20) [pid = 22749] [serial = 36] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.127Z] 13:54:43 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 4 (7f6b12c69090) [pid = 22749] [serial = 38] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.128Z] 13:54:43 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 3 (7f6b12c69a40) [pid = 22749] [serial = 40] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.148Z] 13:54:43 INFO - GECKO(22659) | [Child 23467, Main Thread] WARNING: '!tsi', file /builds/worker/checkouts/gecko/dom/base/Document.cpp:1656
[task 2023-04-11T13:54:43.617Z] 13:54:43 INFO - GECKO(22659) | ### XPCOM_MEM_BLOAT_LOG defined -- logging bloat/leaks to /tmp/tmpsk5zx8p_.mozrunner/runtests_leaks_tab_pid23543.log
[task 2023-04-11T13:54:43.621Z] 13:54:43 INFO - GECKO(22659) | [23543, Main Thread] WARNING: XPCOM_MEM_BLOAT_LOG is set, disabling native allocations.: file /builds/worker/checkouts/gecko/tools/profiler/core/platform.cpp:345
[task 2023-04-11T13:54:43.629Z] 13:54:43 INFO - GECKO(22659) | [Child 23543, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/xre/nsXREDirProvider.cpp:475
[task 2023-04-11T13:54:43.639Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 18 (7f053e491800) [pid = 22659] [serial = 30] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.643Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 17 (7f053164d400) [pid = 22659] [serial = 35] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.645Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 16 (7f0531646000) [pid = 22659] [serial = 40] [outer = 0] [url = chrome://global/content/commonDialog.xhtml]
[task 2023-04-11T13:54:43.647Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 15 (7f0538deb000) [pid = 22659] [serial = 37] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.649Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 14 (7f053164b800) [pid = 22659] [serial = 19] [outer = 0] [url = chrome://global/content/commonDialog.xhtml]
[task 2023-04-11T13:54:43.658Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 13 (7f053164ec00) [pid = 22659] [serial = 33] [outer = 0] [url = chrome://global/content/commonDialog.xhtml]
[task 2023-04-11T13:54:43.658Z] 13:54:43 INFO - GECKO(22659) | [Child 23543, Main Thread] WARNING: could not set real-time limit in CubebUtils::InitLibrary: file /builds/worker/checkouts/gecko/dom/media/CubebUtils.cpp:655
[task 2023-04-11T13:54:43.670Z] 13:54:43 INFO - GECKO(22659) | [Child 23543, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/xre/nsXREDirProvider.cpp:475
[task 2023-04-11T13:54:43.671Z] 13:54:43 INFO - GECKO(22659) | [Child 23543, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/xre/nsXREDirProvider.cpp:475
[task 2023-04-11T13:54:43.675Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 12 (7f053e499400) [pid = 22659] [serial = 32] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.676Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 11 (7f053a34d800) [pid = 22659] [serial = 26] [outer = 0] [url = chrome://global/content/commonDialog.xhtml]
[task 2023-04-11T13:54:43.696Z] 13:54:43 INFO - GECKO(22659) | [Parent 22659: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 10 (7f0538dea800) [pid = 22659] [serial = 39] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:43.707Z] 13:54:43 INFO - GECKO(22659) | [Child 23543, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /builds/worker/checkouts/gecko/toolkit/xre/nsXREDirProvider.cpp:475
[task 2023-04-11T13:54:46.837Z] 13:54:46 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 3 (7f1972a39c00) [pid = 22818] [serial = 32] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:46.838Z] 13:54:46 INFO - GECKO(22659) | [Child 22818: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 2 (7f1972a38800) [pid = 22818] [serial = 30] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:47.001Z] 13:54:47 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 2 (7f6b0da22000) [pid = 22749] [serial = 37] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:47.002Z] 13:54:47 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 1 (7f6b0da21000) [pid = 22749] [serial = 41] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:47.003Z] 13:54:47 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 0 (7f6b0da1e000) [pid = 22749] [serial = 39] [outer = 0] [url = about:blank]
[task 2023-04-11T13:54:56.977Z] 13:54:56 INFO - GECKO(22659) | [Child 23467: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 2 (7f448e333400) [pid = 23467] [serial = 2] [outer = 0] [url = about:blank]
[task 2023-04-11T13:55:02.576Z] 13:55:02 INFO - GECKO(22659) | ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
[task 2023-04-11T13:56:12.518Z] 13:56:12 INFO - TEST-INFO | started process screentopng
[task 2023-04-11T13:56:12.768Z] 13:56:12 INFO - TEST-INFO | screentopng: exit 0
[task 2023-04-11T13:56:12.768Z] 13:56:12 INFO - Buffered messages logged at 13:54:42
[task 2023-04-11T13:56:12.768Z] 13:56:12 INFO - Console message: [JavaScript Warning: "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/" {file: "chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js" line: 23}]
[task 2023-04-11T13:56:12.768Z] 13:56:12 INFO - Console message: [JavaScript Warning: "Redirecting to data: URI not allowed (Blocked loading of: “data:text/html,<script>window.location.href='http:...”)"]
[task 2023-04-11T13:56:12.768Z] 13:56:12 INFO - Buffered messages finished
[task 2023-04-11T13:56:12.768Z] 13:56:12 INFO - TEST-UNEXPECTED-FAIL | toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js | Test timed out -
[task 2023-04-11T13:56:12.772Z] 13:56:12 INFO - TEST-PASS | toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js | Should be no active installs at the end of the test -
[task 2023-04-11T13:56:12.772Z] 13:56:12 INFO - GECKO(22659) | MEMORY STAT | vsize 3171MB | residentFast 513MB | heapAllocated 240MB
[task 2023-04-11T13:56:12.772Z] 13:56:12 INFO - TEST-OK | toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js | took 90040ms
[task 2023-04-11T13:56:12.772Z] 13:56:12 INFO - Not taking screenshot here: see the one that was previously logged
[task 2023-04-11T13:56:12.773Z] 13:56:12 INFO - TEST-UNEXPECTED-FAIL | toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js | Found a tab after previous test timed out: http://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/redirect.sjs?mode=redirect -
[task 2023-04-11T13:56:12.773Z] 13:56:12 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 7f6b0da1dc00 == 1 [pid = 22749] [id = 19]
[task 2023-04-11T13:56:12.773Z] 13:56:12 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 1 (7f6b12c69090) [pid = 22749] [serial = 42] [outer = 0]
[task 2023-04-11T13:56:12.773Z] 13:56:12 INFO - GECKO(22659) | [Child 22749: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 2 (7f6b0da1e000) [pid = 22749] [serial = 43] [outer = 7f6b12c69090]
[task 2023-04-11T13:56:12.773Z] 13:56:12 INFO - checking window state
[task 2023-04-11T13:56:12.885Z] 13:56:12 INFO - TEST-START | toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
| Assignee | ||
Comment 17•2 years ago
|
||
Well, try is green, so here goes nothing...
Comment 18•2 years ago
|
||
Comment 19•2 years ago
|
||
| bugherder | ||
Description
•