Assert that all windows/dialogs have a CSP
Categories
(Core :: DOM: Security, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox137 | --- | fixed |
People
(Reporter: tschuster, Assigned: tschuster)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [domsecurity-meta])
Attachments
(2 files)
We already assert that about: pages have a CSP (See nsContentSecurityUtils::AssertAboutPageHasCSP
) we should do something similar for windows/dialogs.
Updated•1 month ago
|
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 1•21 days ago
|
||
Assignee | ||
Comment 2•20 days ago
|
||
I think I've found all or most chrome documents without a CSP that are loaded during tests now.
Assignee | ||
Comment 3•15 days ago
|
||
Updated•9 days ago
|
Updated•9 days ago
|
Assignee | ||
Updated•8 days ago
|
Assignee | ||
Updated•8 days ago
|
Backed out for causing mass failures
Assignee | ||
Updated•6 days ago
|
Comment 7•6 days ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1f38e5f88eb8
https://hg.mozilla.org/mozilla-central/rev/dbf2787916d6
https://hg.mozilla.org/mozilla-central/rev/76f3a9227fc6
Comment 8•6 days ago
•
|
||
Could we have some guidance on how to properly port this to Thunderbird?
Our tests in our debug builds are borked https://treeherder.mozilla.org/jobs?repo=comm-central&revision=53ee78223fb053bd26e1b978b74010fe2f6f79aa&selectedTaskRun=OViVBivoQKKdIC77j0iYig.0
- Should we just add
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'"/>
to all our pages? - Why some pages are allowed to not have a CSP? https://hg.mozilla.org/mozilla-central/rev/1f38e5f88eb8#l2.60
- Could you shed some light on why there's a static pref to disable CSP for browser.xhtml? https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.yaml#15890
- What's the reason behind having a build flags for the CSP only on browser but not other pages? https://searchfox.org/mozilla-central/source/browser/base/content/browser.xhtml#32-34
Any help or pointing to the right documentation is greatly appreciated.
Comment 9•6 days ago
|
||
Would it be possible to back this out.
This caused mass bustages and multiple test carshes to Thunderbird.
Assignee | ||
Comment 10•5 days ago
•
|
||
(In reply to Alessandro Castellani [:aleca] from comment #8)
Could we have some guidance on how to properly port this to Thunderbird?
Our tests in our debug builds are borked https://treeherder.mozilla.org/jobs?repo=comm-central&revision=53ee78223fb053bd26e1b978b74010fe2f6f79aa&selectedTaskRun=OViVBivoQKKdIC77j0iYig.0
- Should we just add
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'"/>
to all our pages?
That would be great, because this is a very secure CSP. Do note that in bug 1946040, I am asserting that all pages that have CSP, have a CSP that is relatively secure. e.g. script-src 'unsafe-inline'
is absolutely forbidden.
- Why some pages are allowed to not have a CSP? https://hg.mozilla.org/mozilla-central/rev/1f38e5f88eb8#l2.60
This is just a temporary measure before we can add a CSP to them. This way, at least, no one introduces new pages without CSPs.
- Could you shed some light on why there's a static pref to disable CSP for browser.xhtml? https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.yaml#15890
browser.xhtml is a special case, because breaking it could break most of the browser UI. So for the worst case we have a way of disabling it. It's also useful to people modifying Firefox, but the pref is meant to be temporary of course.
- What's the reason behind having a build flags for the CSP only on browser but not other pages? https://searchfox.org/mozilla-central/source/browser/base/content/browser.xhtml#32-34
See above. We wanted to be able to do a slower rollout of the CSP for browser.xhtml
Any help or pointing to the right documentation is greatly appreciated.
See e.g. this firefox-dev post.
If you don't care about CSPs in Thunderbird you could add "chrome://mail/" to sAllowedChromePagesWithNoCSP
.
Updated•5 days ago
|
Updated•3 days ago
|
Description
•