VideoDocument starts loading stylsheets/scripts before ClientSource (and thus the ClientInfo) is initialized.
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: tschuster, Assigned: tschuster)
References
Details
(Keywords: sec-other, Whiteboard: [adv-main140-])
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
When loading a VideoDocument, we will start loading stylesheets and scripts from VideoDocument::SetScriptGlobalObject. This function is called from nsGlobalWindowOuter::SetNewDocument. However SetNewDocument calls nsGlobalWindowInner::ExecutionReady (which calls EnsureClientSource()) only afterwards. That means we start loading before the document's ClientSource and thus ClientInfo are initialized!
Is there some other point afterwards that we could use to start loading?
| Assignee | ||
Updated•10 months ago
|
Comment 1•10 months ago
|
||
The current setup seems to be there on purpose https://bugzilla.mozilla.org/show_bug.cgi?id=708431
But extensions shouldn't use nsIContentPolicy directly anymore.
| Assignee | ||
Comment 2•10 months ago
•
|
||
I think we do have to worry about page's CSP blocking the script when using a data: or blob: iframe, which would inherit the CSP.
Edit: We can probably just special case these URLs in SubjectToCSP. I am looking.
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Updated•10 months ago
|
Updated•10 months ago
|
| Assignee | ||
Comment 3•10 months ago
|
||
I don't think this warrants sec-moderate by itself. We were purposefully bypassing some security checks, because we don't want the load of these internal sheets and scripts to be blocked (by e.g. extensions or a page's CSP). I mostly filed this as a security bug, because this work blocks bug 1966927 and I didn't want to accidentally leak something.
| Assignee | ||
Comment 4•10 months ago
|
||
Updated•10 months ago
|
Updated•10 months ago
|
| Assignee | ||
Comment 5•10 months ago
|
||
Without the exemption added to SubjectToCSP the existing test test_videocontrols_standalone.html would fail with this CSP.
| Assignee | ||
Updated•10 months ago
|
| Assignee | ||
Updated•10 months ago
|
Comment 7•10 months ago
|
||
Comment 8•10 months ago
|
||
(In reply to Tom Schuster (MoCo) from comment #3)
I don't think this warrants sec-moderate by itself. We were purposefully bypassing some security checks, because we don't want the load of these internal sheets and scripts to be blocked
Thanks. When I rated it I didn't realize it was only a couple of hardcoded internal resources. Those are going to be exempt from being blocked by CSP anyway so nothing is being bypassed.
Comment 9•10 months ago
|
||
The patch landed in nightly and beta is affected.
:tschuster, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox140towontfix.
For more information, please visit BugBot documentation.
Updated•10 months ago
|
| Assignee | ||
Comment 10•9 months ago
|
||
Comment on attachment 9490002 [details]
Bug 1967731 - Simplify loading in VideoDocument. r?smaug
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency:
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky):
- String changes made/needed:
- Is Android affected?: Yes
| Assignee | ||
Comment 11•9 months ago
|
||
Required for bug 1966927.
Comment 12•9 months ago
|
||
Comment on attachment 9490002 [details]
Bug 1967731 - Simplify loading in VideoDocument. r?smaug
Approved for 140.0b7
Comment 13•9 months ago
|
||
| uplift | ||
Updated•9 months ago
|
Updated•9 months ago
|
Comment 14•9 months ago
|
||
Comment 15•9 months ago
|
||
Updated•9 months ago
|
Updated•3 months ago
|
Description
•