Closed Bug 1500083 Opened 6 years ago Closed 6 years ago

Consider exempting TYPE_XBL loads from CSP

Categories

(Core :: DOM: Security, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: ckerschb, Assigned: ckerschb)

References

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file, 1 obsolete file)

Once we move the CSP away from the Principal and into the Client (See Bug 965637) and in particular once we let systemPrincipal calls through to CSP (see Bug 1496418) we will be starting to block loads of TYPE_XBL within default-src if not whitelisted by the CSP. I don't think we want that actually, because XBL is a browser internal thing. Potentially we should update subjectToCSP() and give loads of TYPE_XBL a free pass.
Assignee: nobody → ckerschb
Blocks: 1496418
Status: NEW → ASSIGNED
Component: DOM → DOM: Security
Priority: -- → P2
Whiteboard: [domsecurity-active]
As an example, the activity stream code which uses default-src 'none' will start blocking chrome://global/content/platformHTMLBindings.xml.
Dan, please see comment 0 for description of the problem. Acceptable, or am I missing something? Please note that at the moment such loads will never get through to CSP because the are system principal loads anyway which we already shortcut and green light within nsContentPolicyUtils.
Attachment #9018238 - Flags: review?(dveditz)
Why is CSP blocking any chrome: url? I thought chrome: and moz-extension: resources got a free pass regardless of the CSP settings. Otherwise we're breaking add-ons/WebExtensions. Or is this special-cased so that we only check chrome: urls (presumably against a CSP whitelist with path, or at least with package) for system privileged pages? In that case we'd _want_ to block XBL that wasn't whitelisted, and default-src: 'none' really means "none -- I want no scripty things at all here".
Flags: needinfo?(ckerschb)
(In reply to Daniel Veditz [:dveditz] from comment #3) > Why is CSP blocking any chrome: url? I thought chrome: and moz-extension: > resources got a free pass regardless of the CSP settings. Initially all chrome: and resource: URIs where whitelisted and not subject to any CSP restrictions. Then we encountered Bug 1432358 and updated that setting. (Folowing we whitelisted a little more within Bug 1490793). So, I guess you are right, I slightly changed the patch to only allow XBL if we are trying to load a chrome: or resource: URI.
Attachment #9018238 - Attachment is obsolete: true
Attachment #9018238 - Flags: review?(dveditz)
Flags: needinfo?(ckerschb)
Attachment #9019013 - Flags: review?(dveditz)
Comment on attachment 9019013 [details] [diff] [review] bug_1500083_whitelist_type_xbl_for_csp.patch Review of attachment 9019013 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, seems better to have a more limited exception like this. Of course the original problem could have been solved by Activity Stream changing their default-src from 'none' to chrome://whatever (but then possibly having to add more directives with explicit 'none'). Hopefully more than just this one page will benefit from this change. r=dveditz
Attachment #9019013 - Flags: review?(dveditz) → review+
(In reply to Daniel Veditz [:dveditz] from comment #5) > Thanks, seems better to have a more limited exception like this. Of course > the original problem could have been solved by Activity Stream changing > their default-src from 'none' to chrome://whatever (but then possibly having > to add more directives with explicit 'none'). Hopefully more than just this > one page will benefit from this change. Indeed, though there are more pages that would have to be updated. So ultimately more pages benefit from that change.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: