Closed Bug 1964249 Opened 1 year ago Closed 11 months ago

Add pref to disable CSP Level 2 Reporting

Categories

(Core :: DOM: Security, enhancement)

Firefox 138
enhancement

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: celenity, Assigned: tschuster)

Details

Attachments

(1 file, 1 obsolete file)

While CSP level 3 reporting appears to respect the dom.reporting.enabled preference, there's currently no way to disable level 2 reporting. Being able to disable these reports would be beneficial to users for a number reasons:

  • CSP reports have privacy/fingerprinting concerns (which is one of the primary reasons uBlock Origin blocks them by default, so this would be useful for privacy-conscious/advanced users.
  • CSP reports consume extra network bandwidth and resources.
  • Especially since these level 2 reports/functionality is marked deprecated (among other reasons), having the ability to disable them could also prove useful to both web and browser developers for testing purposes.
  • Since level 3 reports can be enabled/disabled via the dom.reporting.enabled preference, (IMO) it only makes logical sense to also allow controlling level 2 reports.
  • Per the Mozilla Manifesto - Individuals must have the ability to shape the internet and their own experiences on it. Not allowing the user to decide whether they want to send these reports seems to go against this principle and Mozilla's values/ideals, and I strongly believe that users should have a choice here. Adding a preference to control this behavior would be directly in line with Mozilla's mission.

To clarify, while I'm personally against the idea of CSP reports like this, I'm not asking for them to be removed or disabled by default, as I also understand the arguments in favor of them and the potential benefits they can provide to website operators. I just feel that having a preference for this would directly benefit users due to the reasons above (and after all, we are the user agent, thus we should act in the best interest of users and allow them to exercise their choice).

Thanks for your time and consideration.

The dom.reporting.enabled preference was a feature-gate, left over from when the Reporting API feature was under development and not yet ready to ship. It wasn't intended to be a privacy feature, and wasn't originally related to CSP's use of that API.

Not saying this isn't a valid enhancement request, but if we pursue it we should make sure the reporting API disabling pref sticks around, too. feature-gates tend to get forgotten about and live for a long time, and then someone will get the idea to clean up the code by getting rid of a bunch of old ones they think no one needs anymore.

Thanks for the quick response.

That makes sense - and I think we should definitely ensure the dom.reporting.enabled pref sticks around as well.

From the spec (9.4):

That said, it can’t be the case that this general benefit be allowed to take priority over the ability of a user to individually opt-out of such a system. Sending reports costs bandwidth, and potentially could reveal some small amount of additional information above and beyond what a website can obtain in-band ([NETWORK-ERROR-LOGGING], for instance). User agents MUST allow users to disable reporting with some reasonable amount of granularity in order to maintain the priority of constituencies espoused in [HTML-DESIGN-PRINCIPLES].

So, the obvious patch just adds a condition to the reporting using the same pref. Would that be okay, Dan? What did you have in mind for making this prefence more meaningful?

Flags: needinfo?(dveditz)

Also adding Tom.

Flags: needinfo?(tschuster)

We can't use the same preference (dom.reporting.enabled) for level 2, because we still haven't enabled the new report API by default. I personally think giving extensions the ability to disable these requests is good enough and we don't need to do anything here.

Flags: needinfo?(tschuster)

I agree it should probably be a different preference, but I strongly disagree with:

I personally think giving extensions the ability to disable these requests is good enough and we don't need to do anything here.

Extensions pose their own privacy and security concerns (as well as can harm performance, etc...), and it's generally a good idea (purely speaking from a privacy & security perspective) to keep them to a minimum. It's also my understanding that as the name suggests, extensions are meant to extend the browser and provide optional functionality. These reports are being generated and sent from the browser itself on the user's behalf, so I don't think it's reasonable to require an extension just to disable them. If we're going to require an extension to disable submission of these reports, perhaps we should require an extension to send them in the first place?

I'd be curious to hear more of the rationale behind your position on this as well.

Assignee: nobody → tschuster
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9488050 - Attachment is obsolete: true
Pushed by tschuster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7a11f77e4907 Add pref to disable all CSP reporting. r=simonf
Regressions: 1966765
No longer regressions: 1966765
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch

(In reply to Simon Friedberger (:simonf) from comment #3)

So, the obvious patch just adds a condition to the reporting using the same pref. Would that be okay, Dan? What did you have in mind for making this prefence more meaningful?

A bit late, but no, I meant CSP reports should not re-use the Reporting API pref —but Tom covered that in comment 5.

We missed an opportunity on the naming, though. You could interpret the Reporting API spec's "reasonable amount of granularity" in different ways, but if we want to interpret that as "per feature" instead of "site by site" (which is unmanageable for most people) we could have dom.reporting.<feature>.enabled prefs, and then share dom.reporting.csp.enabled to cover both new and old reporting once we do hook up the Reporting API to CSP. But that's bikeshedding and unimportant. If we ever do implement the recommended granularity we can figure out pref names at that time.

Flags: needinfo?(dveditz)
QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: