Block downloads in sandbox before checking for potentially unsafe downloads
Categories
(Core :: DOM: Security, defect)
Tracking
()
People
(Reporter: tschuster, Assigned: tschuster)
References
(Regression)
Details
(Keywords: regression, sec-low, Whiteboard: [adv-main141-])
Attachments
(1 file, 1 obsolete file)
https://searchfox.org/mozilla-central/rev/0fe159e3c1a09d9cd22b0ceadbe01efc7e8fd788/dom/security/nsContentSecurityUtils.cpp#2242-2248 on the other hand looks worrisome. Why is that before the sandbox check.
We shouldn't even try to check if a download is potentially insecure due to mixed content, we should just block it if the sandbox flags don't allow it.
Currently we also allow downloads triggered by the system principal to bypass the sandbox flags, but not the mixed content blocking. I am not sure if that is really intentional either. It seems backwards to me?
| Assignee | ||
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Set release status flags based on info from the regressing bug 1558394
| Assignee | ||
Comment 2•1 year ago
|
||
| Assignee | ||
Comment 3•1 year ago
|
||
Not sure about the rating, here? Maybe sec-low?
Need-info myself so I don't forget to write a test for this.
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 7•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 8•1 year ago
|
||
(In reply to Tom Schuster (MoCo) from comment #0)
Currently we also allow downloads triggered by the system principal to bypass the sandbox flags, but not the mixed content blocking. I am not sure if that is really intentional either. It seems backwards to me?
I don't know where this check lives, but fwiw bug 1668530 (and its sibling bugs around uBlock Origin and similar mechanisms, as well as network failures) may be relevant to your interests?
| Assignee | ||
Comment 9•1 year ago
|
||
We ended up removing this check here: https://hg-edge.mozilla.org/mozilla-central/rev/46f7b4cf0509#l1.44. There really shouldn't be a reason for the system principal to bypass the sandbox flags here. It seems like at some point the code was meant to allow the system principal to bypass the mixed content check, but that was broken by some refactoring.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 10•1 year ago
|
||
I have tried writing a test for this, but haven't succeeded so far. Usually it seems like we would already block mixed content downloads from inside iframes via nsMixedContentBlocker::ShouldLoad before ever reaching nsContentSecurityUtils::ClassifyDownload.
Comment 11•1 year ago
|
||
Set release status flags based on info from the regressing bug 1558394
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Did you want to nominate this for ESR140/ESR128 uplift?
| Assignee | ||
Comment 13•1 year ago
•
|
||
I don't think we need to uplift this. It's not even 100% clear if this is an actual issue.
Updated•1 year ago
|
Updated•7 months ago
|
Description
•